V1 Ads API Error Format


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:


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?


I have same problem.
How can i fix it?