I am using the new GOOGLE My Business Information API in JAVA, according to this link. I read all possible attributes that GOOGLE has considered for various Categories and the related Attributes. The API is supposed to return a value named DEPRECATED if the attribute is going to be deprecated. However, I have an attribute named: attributes/pay_debit_card which has a BOOL type and is not deprecated. The returned attribute is like the photo: enter image description here.

The problem is that when I send the updatedAttributes to Google according according to this link, the API returns an error:

{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Requested entity was not found.",
    "reason" : "notFound"
  } ],
  "message" : "Requested entity was not found.",
  "status" : "NOT_FOUND"
}

The code works well for other attributes. I provide some abstract lines of my code in java while the attribute type is BOOLEAN: supposing theAttributeId is a string value equal to pay_debit_card and the variable myBusinessBusinessInformation is the initializer of type com.google.api.services.mybusinessbusinessinformation.v1.MyBusinessBusinessInformation and also takes care of credentials.

    String attributeMask="attributes/"+theAttributeId;
    String name ="locations/"+locationId+"/attributes";
    List<Object> values=null;
    values=Arrays.asList(true); // for example to set it true
    Attribute attribute = new Attribute().setValueType(valueType).setValues(values).setName(theAttributeId);
                                attributes.add(attribute);

try {
UpdateAttributes request = myBusinessBusinessInformation.locations()
                                    .updateAttributes(name, new Attributes().setAttributes(attributes))
                                    .setAttributeMask(attributeMask);
                            request.execute();
}catch (IOException e) {
 System.out.println(e);
}
0

There are 0 answers