V1 Ads API Error Format


#1

I noticed that in earlier versions of the Ads API, the error format was inconsistent by reading this other note ~ https://twittercommunity.com/t/api-error-message-inconsistent-format/8220.

Is the error format consistent for Ads API 1.0? If so, what is the error format for batch and non-batch operations? Does it match what’s described below?

For example, from the endpoint:

https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/promoted_accounts

we can get an array of errors in the response:

“errors”: [
{
“code”: “INVALID_USER_ID”,
“message”: “You cannot promote someone else’s account”,
“attribute”: “user_id”
}
],

For the new batch campaign creation endpoint ( https://dev.twitter.com/ads/reference/post/batch/accounts/%3Aaccount_id/campaigns ), we seem to also get an errors array, and then we get individual “operation_errors” arrays on objects contained within the param object.

Do we always get message, code, and attribute on all errors now? Are operation_errors always in the same format as global request errors?


#2

I have same problem.
How can i fix it?

:sob: