How to propely parse GAM API errors

52 views
Skip to first unread message

Taras Repetukha

unread,
Jan 5, 2023, 7:42:44 AM1/5/23
to Google Ad Manager API Forum
Hello)
In our application we use GAM API integration.

In our app user can create line items and push them into GAM. 
1. So our first main issue:
- User creates 2 line items
- He populate them with some specific data
- If the data is invalid, we receive an error from GAM
- We need to show him which error related to which line item in our application.
So in our example if user pushes 2 line items with invalid data we receive for example a message:
"[NotNullError.NULL @ lineItem[0].lineItem[2].lineItem[1].primaryGoal.units, LineItemError.CREATIVE_SET_ROADBLOCK_NOT_ALLOWED @ lineItem[0].lineItem[2].lineItem[1].roadBlockingType, 
LineItemFlightDateError.START_DATE_TIME_IS_IN_PAST @ lineItem[0].lineItem[2].lineItem[1].startDateTime ]"

How can we map line items with appropriate errors?
In the beginning, we thought that we can use this info:
 lineItem[0].lineItem[2].lineItem[1] - so if we push 2 line items, GAM will return the index of invalid line item so we can map line item in our app with appropriate error message.

But it turned out that every time lineItem[0].lineItem[2].lineItem[1]  - this part is the same, so we can't understand what error correspond to what line item.
Maybe, does anyone could help us with this please?

2. If we can't do this and this is an old GAM api error parse behavior, can we check the errors in our app before making a push? Using a library for that.
 Currently, I didn't find  a way to validate all the data in the beginning, maybe we could catch some basic invalid data before the push using library? And show to a user that these lines contains errors.

Ad Manager API Forum Advisor

unread,
Jan 5, 2023, 12:39:50 PM1/5/23
to google-doubleclick...@googlegroups.com
Hi,

Thank you for reaching out to the Ad Manager API support team, this is Madhushree.

Please note the bulk actions do not have partial failures. If there is a problem with a single object, the entire request fails and no data is persisted. To investigate this further, kindly provide us with the following details. You can send them via Reply privately to the author option, or a direct private reply to this email. 
  • Network Code
  • User Email
  • Complete SOAP request and response logs of the request which you received an error (SOAP logging must be enabled)
You can use Test networks which help you test your code before pushing to the production environment. You should build and test code using test networks before you start using it against your production account. 

Regards,
Google Logo
Madhushree
Ad Manager API Team
 

 

ref:_00D1U1174p._5004Q2hZy2T:ref
Reply all
Reply to author
Forward
0 new messages