Search code examples
javagoogle-my-business-apigoogle-my-business

Is there a limitation on primary Category of a location in Google My Business (PlaceActionLinks) for creating Place Action Links?


I am trying to create an "APPOINTMENT" action type link for the location we manage, following this link and I have this error

    {
  "code" : 400,
  "details" : [ {
    "@type" : "type.googleapis.com/google.rpc.ErrorInfo",
    "reason" : "INVALID_LOCATION_CATEGORY"
  } ],
  "errors" : [ {
    "domain" : "global",
    "message" : "Request contains an invalid argument.",
    "reason" : "badRequest"
  } ],
  "message" : "Request contains an invalid argument.",
  "status" : "INVALID_ARGUMENT"
}

the location's primaryCategory is categories/gcid:womens_clothing_store

I am sending the request via JAVA (suppose myBusinessPlaceActions is a variable which takes care of Authentication and initialising the API):

  PlaceActionLink link = new PlaceActionLink();
                    link.setUri("The APPONTMENT URL");
link.setPlaceActionType("APPOINTMENT"); 
        MyBusinessPlaceActions.Locations.PlaceActionLinks.Create requestCreate= myBusinessPlaceActions.locations().
                                placeActionLinks().create("locations/ MY LOCATIONID", link);

The Same Code is running correctly for other client and locations, for example a location with primary category =categories/gcid:cosmetics_store or another client and location with category =categories/gcid:spa_and_health_club What is wrong?


Solution

  • The error message INVALID_LOCATION_CATEGORY indicates that this category in particular is not eligible for the "APPOINTMENT" place action type.

    For a full list of error codes and their explanations, see the Place Actions reference.

    If you did manage to produce a place action link for a location with the category categories/gcid:womens_clothing_store, that location may either have a different category as well through which that place action link was created or that category might have place action links of that type enabled in one country and disabled in another country.