Problem
If you are making REST API call using SSIS PowerPack or ODBC Drivers such as below and you faced 404 Error ?
Request:
POST https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fzappysys.com/searchAnalytics/query?key={YOUR_API_KEY}
{
"startDate": "2018-11-01",
"endDate": "2018-11-15"
}
And you get below error?
System.Net.WebException: The remote server returned an error: (404) Not Found.
Response Url: https://www.googleapis.com/webmasters/v3/sites/https://zappysys.com/searchAnalytics/query
Status Code: NotFound
Notice that in Request URL %2F%3F%3F is decoded back to :// (see Request ( Raw) panel)
Cause
By default characters encoded characters in URL Path is Decoded back. So for example https%3A%2F%2F will be changed to https:// when URL is sent to API Server. This obviously creates problem because it must remain Encoded inside URL Path (Path is anything before ? in URL).
Solution
Add --dont-escape-- suffix in URL
For example change original URL as below to fix the error.
https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fzappysys.com/searchAnalytics/query--dont-escape--
After you change as above and click Test notice how it shows unchanged URL in request (%2F and %3F is not changed)
For more information check this link.
Using JSON Source - Read Google Search Console API Example
Now lets look at
URL
https://www.googleapis.com/webmasters/v3/sites/<<https://zappysys.com,FUN_URLENC>>/searchAnalytics/query--dont-escape--
POST
{
"startDate": "2019-01-01",
"endDate": "2019-01-10",
"dimensions" : ["date","country"]
}
Contact Us
If you have more question(s) feel free to contact us via Live chat or email to support@zappysys.com
Comments
0 comments
Please sign in to leave a comment.