Hi
I’m using Codeless with an APIService to call a google search api using the http block.
When I invoke the call, I am getting the following error:
{
“code”: 0,
“message”: “{“error”:{“errors”:[{“domain”:“usageLimits”,“reason”:“keyInvalid”,“message”:“Bad Request”}],“code”:400,“message”:“Bad Request”}}”
}
When I use the cURL statement generated by Backendless, I get the same error as above:
curl -X “GET” “https://api.backendless.com/A603AF06-3DDD-6D47-FF01-D559C4DF9300/2F5D244B-421F-7DF6-FF7C-89DE2065ED00/services/GoogleSearch/getGoogleSearch?q=“window%20suppliers”&cx=“004622423927607956040%3Aaqbe3g8agpg”&key=“AIzaSyDHSauVwSIwVs5boAuEgnXZJL4DcitzoKo””
-H ‘Content-Type: application/json’
-H ‘Accept: application/json’
I know that the API key I’m using is valid as the request to the google api directly in cURL works fine and returns the JSON from Google.
When I strip the %22 from the Backendless cURL command, it does work in cURL :
curl -X “GET” “https://api.backendless.com/A603AF06-3DDD-6D47-FF01-D559C4DF9300/2F5D244B-421F-7DF6-FF7C-89DE2065ED00/services/GoogleSearch/getGoogleSearch?q=window%20suppliers&cx=004622423927607956040%3Aaqbe3g8agpg&key=AIzaSyDHSauVwSIwVs5boAuEgnXZJL4DcitzoKo”
-H ‘Content-Type: application/json’
-H ‘Accept: application/json’
Can you please explain what I might be doing wrong ?
Thanks
Paul