Hello!
I am trying to upload offline conversions to a specific floodlight using a service account and I am getting the following error:
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Insufficient Permission",
"reason" : "insufficientPermissions"
} ],
"message" : "Request had insufficient authentication scopes.",
"status" : "PERMISSION_DENIED"
}
This is my java code for the autentication:
InputStream credentials= StorageUtils.getFileAsInputStream([MY_JSON]);
GoogleCredential credential = GoogleCredential .fromStream(credentials) .createScoped(DfareportingScopes.DDMCONVERSIONS);
If I change the scope to DfareportingScopes. DFATRAFFICKING and ask about my userRolePermissions with this Java code:
UserRolePermissionsListResponse rolepermis = reporting.userRolePermissions().list(profileId).execute();
for (int j = 0; j < rolepermis.getUserRolePermissions().size(); j++) {
System.out.println(rolepermis.getUserRolePermissions().get(j).getName());
}
I can see that i have this one “Insert offline conversions"
So why i have the 403 error when im trying to upload offline conversions
Thanks in advance!!
--
You received this message because you are subscribed to the Google Groups "Google's DoubleClick Campaign Manager API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-doubleclick-for-ad...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-doubleclick-for-advertisers-api/f709e80b-dd07-45bc-aa4e-d535840ca0fcn%40googlegroups.com.
Daniel González
Developer Dynamo.Video
skype [dan...@dynamo.video]
[ Calle Sant Quintí 47-53, Entrl 5ª - 08041 Barcelona ]
|
||||||
Thank you very much for your replies!
whether I put permission DDMCONVERSIONS or if I put both (DFATRAFFICKING and DDMCONVERSIONS, :
InputStream credentials= StorageUtils.getFileAsInputStream(“MY_JSON”);
GoogleCredential credential = GoogleCredential.fromStream(credentials) .createScoped(ImmutableSet.of(DfareportingScopes.DFATRAFFICKING)) .createScoped(ImmutableSet.of(DfareportingScopes.DDMCONVERSIONS));
I got the same error:
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Insufficient Permission",
"reason" : "insufficientPermissions"
} ],
"message" : "Request had insufficient authentication scopes.",
"status" : "PERMISSION_DENIED"
}
What could be the problem?
Thanks again!!
{
"issued_to": "#####",
"audience": "#####",
"scope": "#####",
"expires_in": #####,
"access_type": "offline"
}
If you are using the correct scope to make a conversion batchInsert call, then scope in the above structure should include 'https://www.googleapis.com/auth/ddmconversions'. More information regarding this can be found here.Thanks again for your help!!
I’m still with problems ☹
If I assign scope DFAREPORTING to my credential (credential.createScoped(OAUTH_SCOPES);) and make the following call (UserProfileList profiles = reporting.userProfiles().list().execute();), when checking the token (credential.getAccessToken()) as you indicate in your email, (: https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=) it returns
{
"issued_to": "118238380506593108484",
"audience": "118238380506593108484",
"scope": "https://www.googleapis.com/auth/dfareporting",
"expires_in": 3566,
"access_type": "online"
}
On the other hand, if I assign scope DDMCONVERSIONS to my credential (credential.createScoped(OAUTH_SCOPES);) and make the following call, (FloodlightActivity floodlightActivity = reporting.floodlightActivities().get(profileId, floodlightActivityId).execute();) it throws an exception
403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Insufficient Permission",
"reason" : "insufficientPermissions"
} ],
"message" : "Request had insufficient authentication scopes.",
"status" : "PERMISSION_DENIED"
}
so I can't get the token to do the check you indicate.
Thanks one more time!
De: DCM API (DoubleClick Campaign Mgr) <dcmapifor...@gmail.com>
Enviado el: viernes, 28 de mayo de 2021 12:01
Para: ELENA LOZANO BUSTILLO <elena.loza...@telefonica.com>
CC: dan...@dynamo.video; google-doubleclick-...@googlegroups.com
Asunto: RE: Upload Offline Conversions (Java) : 403 Error
Hi there,
Hi Elena,
I work with teejay. Allow me to assist you.
@Daniel Thank you for sharing your insights.
@Elena You need to have both scopes DFAReporting and DDMConversion in creating your credential in order to fulfill this action. Reading from the thread, I can see that in your previous mails you tried to passed both DDMConversion and DFATrafficking scopes instead of DFAReporting and DDMConversion, hence you are getting the permission denied error.
And from your latest message you are only passing the DFAReporting scope to your credential. Upon updating this, you should be able to upload offline conversions successfully.
Regards,
|
||||||
Thank you very much both of you!! With your suggestions, now it’s working!!!!!
De: DCM API (DoubleClick Campaign Mgr) <dcmapifor...@gmail.com>
Enviado el: martes, 1 de junio de 2021 6:10
Para: ELENA LOZANO BUSTILLO <elena.loza...@telefonica.com>
CC: dan...@dynamo.video; google-doubleclick-...@googlegroups.com
Asunto: RE: Upload Offline Conversions (Java) : 403 Error
Hi Elena,