My Business
3K members online now
3K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Want to patch telephone number with international number

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Dear Google team member,

 

I am using the Java API for Google My Business on behalf of one of our customers. That customer has stores in multiple countries that are managed by different Google My Business accounts. The customer wants to automate managing his Google My Business data. My application imports locations given in an XML file, transforms them to com.google.api.services.mybusiness.v3.model.Location instances and insert or patches them. The choice whether to insert or patch is made using a Big Query table that mirrors Google My Business. My import process thus does the following: (a) Import locations from an XML file produced by our customer; (b) compare with a BQ table that mirrors the current state of Google My Business; (c) Update that BQ table; and (d) transform the customer-provided locations to GMB locations and either insert or patch them.

 

I tested my application with locations in the Netherlands. The customer provides telephone numbers like "+31 882459900". Such numbers can be inserted without an error message, but patching with such telephone numbers produces an error message. I added the header for detailed error messages, so I could see the telephone number was the problem. When I added Java code to transform the telephone number to be like "088 245 9900" before patching, the error message disappeared.

 

Now I have the following questions:

 

i)

Does the Java GMB API provide an option to patch with international telephone numbers (e.g. accept "+31 882459900") like is possible when inserting? Or does it provide functionality to transform international telephone numbers to local telephone numbers (e.g. map "+31 882459900" to "088 245 9900"? Writing such mappers myself is a problem because my customer is active in different countries. I do not want to build a new release each time a new country is introduced.

 

ii)

Is there a way to disable checking altogether? Allowing locations with incorrectly formatted fields to be uploaded nevertheless to Google My Business, may be acceptable for our customer. The Google My Business UI gives information about these locations. We can ask our customer to review the Google My Business UI regularly and correct errors manually. Such a semi-automated workflow may still be better then the non-automated workflow they have now.

 

With kind regards,

 

Martijn Dirkse

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Martijn D
October 2016

Re: Want to patch telephone number with international number

Google Employee
# 5
Google Employee

Hi @Martijn D,

 

I’ve verified that phone numbers are automatically converted from international format to national format when sending requests to modify the primaryPhone and additionalPhones fields in a specified location via the Google My Business API. However, phone numbers that include the dial out code (e.g. 011 61 2 9374 4001 is dialed from US to AU) are still not accepted in a request and will raise an exception with a 400 Bad Request error to indicate a validation failure. Therefore, I still recommend using Google's libphonenumber library for parsing, formatting, and validating international phone numbers prior to sending requests to modify a location with phone numbers that may include the dial out code via the Google My Business API.

 

Please feel free to “ACCEPT AS SOLUTION” for the post that you think is most accurate at your own discretion.

 

Thanks,

Terry

View solution in original post

Re: Want to patch telephone number with international number

Google Employee
# 2
Google Employee

Hi @Martijn D,

 

i) You can use the Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers prior to sending requests to create or update a location via the Google My Business API.

 

ii) You should make sure that the business information including phone number(s) you provide to Google is accurate and up-to-date, otherwise you may invoke validation failures via the API or you may be asked to fill in fields that are missing required information in the Google My Business UI. Phone numbers must be valid in the country where your location is located. Learn more about business information guidelines for phone numbers

 

Thanks,

Terry

Want to patch telephone number with international number

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Dear Terry,

 

Thank you very much. I expect that your solution will work.

 

I apologize that I did not try it yet and I did not give you feedback. To work in an agile way, the first version of our application will only manage locations for a specific country. This first version can be built without addressing the issue I described. We will try it later when we build the next release.

 

With kind regards,

 

Martijn Dirkse

 

Want to patch telephone number with international number

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Dear Terry,

 

Today I tested whether this issue still persists. The answer is no.

 

To see this, did the following:

* I emptied my test account of Google My Business.

* I uploaded three Spanish locations with international telephone numbers (+xx xxxx)

* I uploaded another Spanish location, but with a storeCode matching an existing location. This is a patch were all fields are updated.

* I did not get a Java exception during this upload like before, and I verified that the telephone number was modified as intended.

 

I thank you for your time, and I thank Google for addressing this. I would like to select a preferred answer to my question to solve this issue, but I cannot. What can I do to properly close this issue?

 

With kind regards,

 

Martijn Dirkse

 

Marked as Best Answer.
Solution
Accepted by topic author Martijn D
October 2016

Re: Want to patch telephone number with international number

Google Employee
# 5
Google Employee

Hi @Martijn D,

 

I’ve verified that phone numbers are automatically converted from international format to national format when sending requests to modify the primaryPhone and additionalPhones fields in a specified location via the Google My Business API. However, phone numbers that include the dial out code (e.g. 011 61 2 9374 4001 is dialed from US to AU) are still not accepted in a request and will raise an exception with a 400 Bad Request error to indicate a validation failure. Therefore, I still recommend using Google's libphonenumber library for parsing, formatting, and validating international phone numbers prior to sending requests to modify a location with phone numbers that may include the dial out code via the Google My Business API.

 

Please feel free to “ACCEPT AS SOLUTION” for the post that you think is most accurate at your own discretion.

 

Thanks,

Terry