Thursday, July 9, 2020

Stricter Validation For DCM/DFA Reporting and Trafficking API

On July 14th, 2020, we will begin enforcing stricter validation for requests to the DCM/DFA Reporting and Trafficking API. This change will initially be introduced for 5% of API traffic during the week of July 14, 10% the week of July 21, 30% the week of July 28, and all requests by August 7th, 2020
As a result, your requests might begin returning additional errors. Please update your requests, as needed. 

The following list includes the error codes that you might see, as well as the recommended solutions:
  • "Invalid value - Enum" - Ensure you are using valid enum values. For more information, see the API Reference.
  • "Invalid value - Bool" - Ensure boolean fields in the request are set to true/false, rather than empty string.
  • "Invalid value - Integer ####.0" - Ensure integer fields in the request are set to valid integers.
  • "Invalid JSON Payload - NaN" - Ensure NaN does not appear in the request payload.
  • "Invalid JSON payload received. - not repeating" - Do not use arrays for non-array fields.
Method specific errors:
  • dfareporting.reports.run: "Invalid JSON payload received. Unexpected end of string. Expected a value" - Ensure the request body is completely empty.
  • dfareporting.reports.list: "Request contains an invalid argument." - Ensure that empty fields in the response contain a valid value. For example, empty array fields must be specified by an empty array, rather than an empty string or object.
  • dfareporting.files.get and dfareporting.reports.files.get: "OAuth token was passed in the query parameter. Please send it in Authorization header instead." - Requests must use the HTTP header Authorization: Bearer [ACCESS_TOKEN] to pass OAuth credentials.

Why is this changing?
Stricter validation helps ensure that problematic requests are not silently ignored, and aligns the behavior of the DCM API with that of other Google APIs.