Invalid country code when using directory.customers.update - google-directory-api

When I call: directory.customers.update with the following info
customerKey: ......
body:
{
"customerDomain": "mydomain.fr",
"alternateEmail": "john.doe#mydomain.be",
"postalAddress": {
"contactName": "John Doe",
"organizationName": "My Domain",
"countryCode": "FR"
}
}
I get {
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid country code"
}
],
"code": 400,
"message": "Invalid country code"
}
}
and this, whatever the country code is

Changing country code is not possible with grandfathered G Suite accounts other than when upgrading to paid version.

Related

Can I create Quotes without specifying UnitAmount

We are generating Quotes from our application using Xero API. We have created our Line Item in Poducts and Services and added price there.
From the API, we do not wish to send Price again, as this is already in Xero. We wish to send LineItem code and perhaps account (Sell vs Purchase) and let Xero use the price.
Can anyone let us know if there is a way to accomplish this, without having to query Xero for the Products and Services prices to build the Quote?
Thank you for your help.
Request:
{
  "Quotes": [
    {
      "Contact": {
        "ContactID": "a852a44c-3d8f-4c4b-a628-3a2c2121b9b1"
      },
      "LineItems": [
        {
          "ItemCode": "BOOK",
          "Description": "BlaBla",
          "Quantity": 1
        }
      ],
      "Date": "2022-12-20",
      "Reference": "Event Name"
    }
  ]
}
Response (error 400):
{
"ErrorNumber": 10,
"Type": "ValidationException",
"Message": "A validation exception occurred",
"Elements": [
{
"Reference": "Event Name",
"Contact": {
"ContactID": "a852a44c-3d8f-4c4b-a628-3a2c2121b9b1"
},
"LineItems": [
{
"Description": "BlaBla",
"ItemCode": "BOOK",
"Quantity": 1.0
}
],
"Date": "\/Date(1671494400000)\/",
"ValidationErrors": [
{
"Message": "Unit Amount cannot be empty"
}
]
}
]
}

Method: licenseAssignments.listForProduct get Error

y try to get the licenses in the organization but in the page get the next error,
{
"error": {
"code": 503,
"message": "Backend Error",
"errors": [
{
"message": "Backend Error",
"domain": "global",
"reason": "backendError"
}
]
}
}
I don't know if the service has a problem or if I put wrong parameters.
Method: licenseAssignments.listForProduct, i need the licenses per users

INVALID_ARGUMENT error with Google Analytics Reporting API

I'm trying to do a request to the userActivity.search method,
this is the payload that I'm trying to do:
{
"viewId": "<VIEW ID>",
"dateRange": {
"startDate": "7daysAgo",
"endDate": "today"
},
"user": {
"type": "CLIENT_ID",
"userId": "<USER ID>"
}
}
But I'm stuck getting this error:
{
"error": {
"code": 400,
"message": "CLIENT_ID: <ID> not found.",
"status": "INVALID_ARGUMENT"
}
}
The ClientId I get previously at other GA endpoint that list the ClientIds that I need to get more details.
What am I doing wrong?

Amadeus: How to get a successful response from the GET /shopping/hotel-offers/by-hotel endpoint?

Seems like no matter what hotel or check-in check-out dates I try, the GET /shopping/hotel-offers/by-hotel endpoint always returns no availability. The GET /shopping/hotel-offers for a city always returns one or more hotels that have availability. I understand that these can be cached results but then using any of those hotels in the GET /shopping/hotel-offers/by-hotel endpoint returns no availability
Example 1
GET https://test.api.amadeus.com/v2/shopping/hotel-offers?cityCode=NYC
(RESPONSE TRUNCATED FOR READABILITY)
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "BWNYC133",
"chainCode": "BW",
"dupeId": "700101379",
"name": "BEST WESTERN BOWERY HANBEE HTL"
...
"available": true,
"offers": [
{
"id": "15F1E33CA0571B94E27F2BA26CA4319C8A097B500D737AB68088E93AC813D2BC",
"rateCode": "SRS",
"rateFamilyEstimated": {
"code": "SRS",
"type": "C"
},
"boardType": "BREAKFAST",
"room": {
"type": "A1Q",
"typeEstimated": {
"category": "ACCESSIBLE_ROOM",
"beds": 1,
"bedType": "QUEEN"
},
}
...
],
...
}
Immediately followed by
GET https://test.api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=BWNYC133
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
The same is true no matter what hotel in any city I try. Am I doing something wrong? I've been playing with the endpoints for a few hours now and have only been able to get a successful response from the hotels by city endpoint.
Appreciate any help provided.
EDIT
My issues are continuing in production now. I am getting no availability from /shopping/hotel-offers/by-hotel or /shopping/hotel-offers/{offerId} endpoints.
GET https://api.amadeus.com/v2/shopping/hotel-offers?cityCode=NYC&hotelIds=XTNYC130,ONNYCMIM,DSNYC132&checkInDate=2020-05-01&checkOutDate=2020-05-03&roomQuantity=1&adults=2&radius=5&radiusUnit=KM&paymentPolicy=NONE&includeClosed=false&bestRateOnly=true&view=FULL&sort=NONE
(RESPONSE TRUNCATED FOR READABILITY)
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "XTNYC130",
"chainCode": "XT",
"dupeId": "700070576"
"name": "DUANE STREET HOTEL",
},
"available": true,
"offers": [
{
"id": "394DF124A254A86DD6DA5D1A3084B543DFA462740EDAE34023151D479266C4DE",
"rateCode": "GMT"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=XTNYC130&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
},
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "ONNYCMIM",
"chainCode": "ON",
"dupeId": "700128992",
"name": "HOTEL MIMOSA"
},
"available": true,
"offers": [
{
"id": "547EA4B5F7F716DF083DFD19D857DAE0F1B6820E753D080F310737C5374AF857",
"rateCode": "BAR"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=ONNYCMIM&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
},
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"hotelId": "DSNYC132",
"chainCode": "DS",
"dupeId": "700224946",
"name": "The Ludlow Hotel"
},
"available": true,
"offers": [
{
"id": "CC8CD3A64562527B6330E1A317584E78B68537B1E682115497037D28CB466FDE",
"rateCode": "RAC"
}
],
"self": "https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=DSNYC132&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=XTNYC130&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=ONNYCMIM&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/shopping/hotel-offers/by-hotel?hotelId=DSNYC132&adults=2&checkInDate=2020-05-01&checkOutDate=2020-05-03&paymentPolicy=NONE&roomQuantity=1&view=FULL
RESPONSE
{
"errors": [
{
"status": 400,
"code": 3664,
"title": "NO ROOMS AVAILABLE AT REQUESTED PROPERTY"
}
]
}
GET https://api.amadeus.com/v2/271FFDEF4E7FD5E1EEB10BFE59B0880B5F6AF4DCA73BA57E5489FDFE7E95AFCD
{
"errors": [
{
"status": 400,
"code": 477,
"title": "INVALID FORMAT"
}
]
}
We are experiencing temporary problems with some of our hotel providers test systems which is leading to slower than usual response times or timeouts as in your example. We tried the same request, and for most of the time, it does work, so while we are working with our providers to resolve this issue, you can try to do the request a few times until you have a response.
Sorry for the inconvenience!

How to solve `not a valid enum value for `address.country` while adding the customer?

I'm integrating the square api's with golang in my software. But there is a problem while I'm sending the add customer request with the below json object
{
"given_name": "Sand Box Customer",
"family_name": "This is a sandbox Family",
"email_address": "sandbox#gmail.com",
"address": {
"address_line_1": "500 Electric Ave",
"address_line_2": "Suite 600",
"locality": "New York",
"administrative_district_level_1": "NY",
"postal_code": "10003",
"country": "Australia"
},
"phone_number": "1-212-555-4240",
"reference_id": "YOUR_REFERENCE_ID",
"note": "a customer"
}
and in response it returns me with an error:-
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "INVALID_ENUM_VALUE",
"detail": "`Australia` is not a valid enum value for `address.country`.",
"field": "address.country"
}
]
}
Why this error I'm facing while It will support the Australia country see in the link https://docs.connect.squareup.com/. How can I solve this error?
documentation link:- https://docs.connect.squareup.com/get-started
According to their documentation, you should specify the country in /ISO_3166-1_alpha-2 format.
Refer the doc
https://docs.connect.squareup.com/api/connect/v2#type-location .
You can find more information from this also https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2