Hi there.
I'm getting this response when accepting a manager link request using 
*https://googleads.googleapis.com/v15/customers/${customer}/customerManagerLinks:mutate*

Invalid customer ID 'CUSTOMER_ID'.

The customer ID in question does *not *include hyphens, and comes directly 
from the Google Ads API itself.

Our flow is the following:
- Create an access link authenticating as the manager account
- Accept the access link as the client account using the generated 
*resourceName*

Here is the code:
await axios.post(`https://googleads.googleapis.com/v15/customers/${
agencyCustomerID}/customerClientLinks:mutate`, {
operation: {
create: {
status: "PENDING",
clientCustomer: `customers/${customer}`,
}
}
}, {
headers: {
"developer-token": process.env.GOOGLE_ADS_DEVELOPER_TOKEN,
Authorization: `Bearer ${accessToken}`
}
}).then((res) => {
// Now the link has been created, we'll accept it acting as the client 
https://developers.google.com/google-ads/api/rest/reference/rest/v15/customers.customerManagerLinks/mutate
const linkResourceName = res.data.result.resourceName
axios.post(`https://googleads.googleapis.com/v15/customers/${customer}
/customerManagerLinks:mutate`, {
operations: [
{
update: {
resourceName: linkResourceName,
status: "ACTIVE"
},
updateMask: "resourceName,status"
}
]
}, {
headers: {
"developer-token": process.env.GOOGLE_ADS_DEVELOPER_TOKEN,
Authorization: `Bearer ${accessToken}`
}
}).then(() => {
...
}).catch(err => {
// Error happens here
...
})
}).catch(err => {
...
})

Here is the full error message:
{
  error: {
    code: 400,
    message: 'Request contains an invalid argument.',
    status: 'INVALID_ARGUMENT',
    details: [
      {
        '@type': 
'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure',
        errors: [
          {
            errorCode: { requestError: 'INVALID_CUSTOMER_ID' },
            message: "Invalid customer ID 'CUSTOMER_ID'.",
            location: {
              fieldPathElements: [
                { fieldName: 'operations', index: 0 },
                { fieldName: 'update' },
                { fieldName: 'resource_name' }
              ]
            }
          }
        ],
        requestId: 'TtHTpWOPj-JKGQnjRq5y2w'
      }
    ]
  }
}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/dad795cd-f113-43a0-a717-da68a75247d4n%40googlegroups.com.
  • IN... Ethan Crabb
    • ... Ethan Crabb
    • ... Ethan Crabb
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
        • ... Ethan Crabb
          • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to