Can anyone please help me with diagnosing why the API endpoint is returning 
a 404 error despite proper configuration?

So far, I've tried:

- Verifying correct project configuration
- Confirmed API is enabled
- Recreated OAuth credentials
- Tried testing with simple GAQL query to fetch campaign data

My problem:

Every API call results in a 404 (Not Found) error
Tested multiple API versions (v14, v15, v16, v17, v18 and v19)
API is confirmed as enabled in Google Cloud Console
OAuth authentication completes successfully
My developer token is valid (Basic)
Customer ID is correctly formatted (no hyphens)
I have a manager account (correctly formatted too)

I added my script below, with auth. codes redacted. I am not a programmer 
and have been seeking help to get this script to work. I'm at a point where 
I can't scream "HELP!" loud enough...

// Account information
const MANAGER_ID = '000000000'; // Manager Account ID
const CUSTOMER_ID = '000000000'; // Customer ID (without hyphens)
const DEVELOPER_TOKEN = '000000000'; // Your developer token

function testGoogleAdsApiConnection() {
  // Simple GAQL query to fetch one campaign
  const query = `
    SELECT
      campaign.id,
      campaign.name
    FROM campaign
    LIMIT 1
  `;
  
  try {
    const url = 
`https://googleads.googleapis.com/v19/customers/${CUSTOMER_ID}:search`;
    
    const response = UrlFetchApp.fetch(url, {
      method: 'post',
      headers: {
        'developer-token': DEVELOPER_TOKEN,
        'login-customer-id': MANAGER_ID,
        'Content-Type': 'application/json',
        'Authorization': 'Bearer ' + ScriptApp.getOAuthToken()
      },
      payload: JSON.stringify({
        query: query
      }),
      muteHttpExceptions: true
    });
    
    // Log the response
    Logger.log('Response Code: ' + response.getResponseCode());
    Logger.log('Response Content: ' + response.getContentText());
  } catch (e) {
    Logger.log('Error: ' + e.toString());
  }
} 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/3bde4276-658e-4bc8-a19b-4b825046ebe6n%40googlegroups.com.

Reply via email to