Error handling for Real-time Bidding API

42 views
Skip to first unread message

Piyush Rane

unread,
Apr 21, 2024, 12:47:07 PMApr 21
to Authorized Buyers API Forum
Hey,
We are using GET and CREATE API from this doc and using these methods
GET -> 
Creative creative client.buyers().creatives().get(name).execute();
CREATE ->
Creative creative = client.buyers().creatives().create(parentBuyerName, newCreative).execute();

We are using this to keep the status of creatives in our database in sync with creatives at AB UI.
While trying out many cases in those APIs we encountered error responses such as:-

1. When we submit a creative that already exists in AB UI
"POST https://realtimebidding.googleapis.com/v1/buyers/<account_id>/creatives
{
  "code" : 409,
  "errors" : [ {
    "domain" : "global",
    "message" : "Requested entity already exists",
    "reason" : "alreadyExists"
  } ],
  "message" : "Requested entity already exists",
  "status" : "ALREADY_EXISTS"
}"

2. When we fetch the status of creative which is not in AB UI
"GET https://realtimebidding.googleapis.com/v1/buyers/<account_id>/creatives/<creative_id>
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Creative with ID <creative_id> was not found.",
    "reason" : "notFound"
  } ],
  "message" : "Creative with ID <creative_id> was not found.",
  "status" : "NOT_FOUND"
}"

3. At AB UI it shows only 1 creative with ID but gives an error response as:
" GET https://realtimebidding.googleapis.com/v1/buyers/<account_id>/creatives/<creative_id>
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Multiple snippets exist for Account ID <account_id> and Creative ID <creative_id>",
    "reason" : "badRequest"
  } ],
  "message" : "Multiple snippets exist for Account ID <account_id> and Creative ID <creative_id>",
  "status" : "INVALID_ARGUMENT"
}

Are there any other errors as well which we need to handle? Can we have a document that has all the error responses so that we can handle those accordingly?

Also, can you specify the reason why we are getting the error mentioned in point 3 when we are not able to see multiple entries on AB UI for the same ID?

Mark Saniscalchi

unread,
Apr 22, 2024, 12:49:49 PMApr 22
to Authorized Buyers API Forum
I'm copying my response here since software on our end created a duplicate thread that lacked the broader context. Sorry about that!

Hello Piyush,

At this time, a document covering every permutation of possible error conditions for each API resource doesn't exist. We generally use appropriate HTTP error codes and provide additional context in the body, but admittedly from an external perspective it isn't always super clear; for example, if you're not already familiar with things like the creative lifecycle, and the concept of inactive creatives, it may seem like a bug that a formerly existing creative became inaccessible. Likewise, the API doesn't support legacy workflows that can allow the creation of duplicate creative IDs, so attempting to duplicate or access creatives that have already been duplicated can result in errors. Given the third error message you sent, the latter is the likely culprit for all three (we already have a bug filed to fix this particular error message in the API).

In short, the legacy workflow I mentioned earlier allows one to submit creatives for review (albeit inefficiently), and has a quirk where creatives of different formats can share the same creative ID. Since this is done through RTB, it's a somewhat common case that customers don't realize they have duplicated a creative ID there with two different formats. This is not a supported workflow in more recent APIs though, so you receive an error response when using them and attempting to access the creative. The recommendation in such instances is to stop using the duplicated ID and recreate the involved creatives with distinct IDs.

Regards,
Mark

Reply all
Reply to author
Forward
0 new messages