Hello, I use Google Ads API with REST Interface Finally I got the curl php code in server side from curl command line, When I run this code
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://googleads.googleapis.com/v9/customers/(8519781266):generateKeywordIdeas'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n\n\"keywordSeed\": {\n \"keywords\": [\n \"cofee\"\n ]\n }\n}"); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Login-Customer-Id: (2260416591)'; $headers[] = 'Developer-Token: (z2sb0uyekDzkMbiyNpAImg'; $headers[] = 'Authorization: Bearer (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)'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } print_r($result); curl_close($ch); I get this Error I think everything is good with my OAuth but what's the reason and how to solve { "error": { "code": 401, "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } } -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/029e2ec1-834f-4967-b33b-5c8d2784c127n%40googlegroups.com.
