Using Google Ads API from browser - CORS

546 views
Skip to first unread message

Hugo

unread,
Jul 1, 2021, 2:25:48 PM7/1/21
to AdWords API and Google Ads API Forum
Hello,

is it possible to use the Google Ads API from a JavaScript application running in the browser?

I tried making a POST request to a URL like this to fetch campaigns for a specific customer:
But I get a CORS error "...has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."

I know the request is correct, as I've tried it successfully using cURL/Postman.

Thanks,
Hugo

Google Ads API Forum Advisor

unread,
Jul 7, 2021, 1:57:55 PM7/7/21
to hcg...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. This issue seems to be browser-specific. Depending on which browser you are using, you should be able to run without CORS, though this is not recommended for general use. This issue is not within out team's support scope, however. If you have any Ads API specific inquiries, we are happy to assist.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 
 

ref:_00D1U1174p._5004Q2JXzFH:ref
Reply all
Reply to author
Forward
0 new messages