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.