CM360 calls from Cloud Functions

8 views
Skip to first unread message

Nikhil Mahajan

unread,
May 9, 2024, 10:23:51 AMMay 9
to Google's Campaign Manager 360 API Forum
I have attached the code i am running from my Cloud Function. I am using "Service Account" key credentials which i have stored in Secret Manager ( Is that allowed OR does it STRICTLY have to be OAuth2.0 )
Anyways, the error i am facing is also in the attached file.

FYI, i was able to create a temp advertiser using POSTMAN ( so that profile-id does have the permissions ; having said that, in Postman i had used OAuth2.0 ) BUT i am not able to do the same using CLOUD FUNCTIONS, using the same profile id i.e. it gives me the error message seemingly suggesting that the "Google Account" cannot access the user-profile/accoutn requested.

Error Message : <HttpError 401 when requesting https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/<PROFILE_ID>/advertisers?alt=json returned "1075 : Failed to authenticate. Google account can not access the user profile/account requested.". Details: "[{'message': '1075 : Failed to authenticate. Google account can not access the user profile/account requested.', 'domain': 'global', 'reason': 'authError', 'location': 'Authorization', 'locationType': 'header'}]">

So, i thought maybe it's the Service Account ( pid-c...@developer.gserviceaccount.com ) INSIDE THE CLOUD FUNCTION that does not have permissions. So, i created an ADMIN user profile inside CM360, with the same email as above, pid-c...@developer.gserviceaccount.com... fetched it's profileid and used that in my code... but it still gave me the same message.

Can you help me with this in what is a rather urgent issue at my end ?
Please advise.
Thanks,
Nikhil.
abfusc_codeFor_Cm360_CreativeCreation_using_ServiceAccount.txt

DCM API (DoubleClick Campaign Mgr)

unread,
May 10, 2024, 12:19:30 AMMay 10
to google-doubleclick-...@googlegroups.com
Hi,

Thank you for reaching out to the DCM API support team.

Upon checking your query, to integrate with the API, the initial steps involve configuring the client library and subsequently authorizing the service account. In order for you to authorize your request on API authorizing requests and you will need to create an application using the Google API Console.

In your application if you are saving tokens you need to clear those values and regenerate the tokens. If you are using installed application or application type of other, then during browser launch (manual step for authorization) make sure you logged in with the email id that is associated with the given profile id. Also, refer to this API document that gives clear information about the authorized access to Google APIs. Unfortunately, our team can only provide technical assistance specific to DCM API response issues and errors. Since this is more on the authorization request, we would recommend reaching out to the Google Console team via this link  for further assistance. Hope this helps.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tIvk9:ref" (ADR-00234343)

Thanks,
 
Google Logo DCM API Team


Reply all
Reply to author
Forward
0 new messages