googleads / googleads-dfa-reporting-samples

Samples for the DoubleClick for Advertisers Reporting and Trafficking API
Apache License 2.0
106 stars 173 forks source link

Question about uploading creatives #106

Open justin-lau-1 opened 4 months ago

justin-lau-1 commented 4 months ago

Hi,

I have several questions regarding inserting a creative via the GCM API. I am using the Java client library to facilitate this operation.

The first question is regarding the API key: When trying to create a creative using the client library and authenticating with a service account, we are getting this response:

Response: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code": 403, "errors": [ { "domain": "global", "message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.", "reason": "forbidden" } ],

"message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.",

"status": "PERMISSION_DENIED"

}

It seems like we can’t use a service account to perform this action. What are the other methods that are acceptable, and what method do you recommend in terms of scaling via API? Can you provide examples of how to do this in the Java client library? For our use case, the user of our API should be able to create a creative without explicitly logging in, which is why a service account is beneficial.

The second question I have is regarding the “PATH_TO_IMAGE_ASSET_FILE” string value required to create a creative. Is this supposed to be a directory path, like "/Users/justin.lau/Desktop/adtech-automation/google_wrapper/src/main/java/adtech_api/google_wrapper/test_image2.png", or should it point to an online url that hosts the image?

I am having trouble thinking of a way to implement this in the API as the hosted API theoretically won’t have access to local image files, and if it did, it would be very difficult to maintain. Any advice regarding this would be greatly appreciated!

Thanks, Justin