hi Google

here is my rest of code where i get error

const apiUrl = '
https://googleads.googleapis.com/v15/customers/9422846517/googleAds:searchStream
';
const query = 'SELECT campaign.id, campaign.name FROM campaign';
// const token = await getAccessToken();
const assertion = createJwtAssertion();
const token = await axios.post('https://oauth2.googleapis.com/token', null,
{
params: {
assertion: assertion,
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
},
});
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token.data.access_token}`,
'developer-token': 'Develper-token',
};
const customers = await axios.get('
https://content-googleads.googleapis.com/v15/customers:listAccessibleCustomers
', { headers })



*Error*:

{
  error: {
    code: 401,
    message: 'Request is missing required authentication credential.
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',
    details: [ [Object] ]
  }
} {
  '@type': '
type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure',
  errors: [
    {
      errorCode: [Object],
      message: 'The Google account (@gmail.com user) that generated the
OAuth access tokens is not associated with any Ads accounts. Create a new
account, or add the Google account to an existing Ads account.'
    }
  ],
  requestId: 'BLp9n91botsBIO1_WrZc6w'
}

On Wed, 3 Jan 2024 at 14:08, Google Ads API Forum Advisor
<adsapi@forumsupport.google> wrote:

> Hi,
>
> Thank you for getting back to us.
>
> In order to investigate further, could you please provide more details
> regarding the issue you are encountering? Also, please provide us with the
> complete API logs and error screenshots.
>
>
> This message is in relation to case "ref:!00D1U01174p.!5004Q02r4kZ4:ref"
>
> Thanks,
>
> [image: Google Logo] Google Ads API Team
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CALswdxdJ3c4fhjfZVW53U%3Dz3R7-5tRjq0fxO-vp%2ByMdYaO9LFw%40mail.gmail.com.
  • Go... Mehul Panchal
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Mehul Panchal
        • ... Mehul Panchal
          • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
            • ... Mehul Panchal
              • ... Mehul Panchal
                • ... Mehul Panchal
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to