Error response in POST request

22 views
Skip to first unread message

Jorge correa herrero

unread,
Apr 1, 2016, 5:13:11 PM4/1/16
to Google API Python Client
When I use google API client for python tu update or create a business, if the json has any error the response exception is this:
{
 "error": {
   "code": 400,
   "message": "Request contains an invalid argument.",
   "errors": [
     {
       "message": "Request contains an invalid argument.",
       "domain": "global",
       "reason": "badRequest"
     }
   ],
   "status": "INVALID_ARGUMENT"
 }
}


But if for example I use https://developers.google.com/oauthplayground/ or python request library the response is that:

{
 "error": {
   "code": 400,
   "message": "Request contains an invalid argument.",
   "status": "INVALID_ARGUMENT",
   "details": [
     {
       "@type": "type.googleapis.com/google.mybusiness.v2.ValidationError",
       "errorDetails": [
         {
           "code": 3,
           "field": "location.primary_category",
           "message": "This category isn't supported in ES. Choose a supported category from the list that appears when you start entering a category.",
           "value": "1"
         }
       ]
     }
   ]
 }
}
Reply all
Reply to author
Forward
0 new messages