Code
See the error codes the Apple News API returned.
Declaration
string CodePossible Values
API_KEY_NOT_FOUNDThe API key specified in the
Authorizationheader does not exist.ARTICLE_TERRITORY_NOT_ALLOWEDA country code for publishing or updating the article is not supported by your channel.
DOES_NOT_EXISTThe section you specified does not exist.
Key path:
data.links.sections.#.DUPLICATE_AUTH_ELEMENTTwo
Authorizationelements with the same scheme were supplied.FORBIDDENYou tried to access a resource that your API key does not have permission to access.
Key path: None.
INCORRECT_HOSTThe section URL has the wrong hostname or port.
Key path:
data.links.sections.#.INVALIDThe
pageTokenparameter is not a valid token returned in anextlink ornextPageTokenfield. Key path:pageTokenThe
sortDirparameter is notASCorDESC. Key path:sortDirThe
fromDateparameter is not in ISO 8601 date format. Key path:fromDateThe
toDateparameter is not in ISO 8601 date format. Key path:toDateThe
pageSizeparameter is not an integer in the range 1 to 100, inclusive. Key path:pageSize.The specified article ID is not a valid
UUID.Key path:data.promotedArticle
INVALID_AUTH_FORMATThe
Authorizationheader parameters were not parseable as key-value pairs separated by semicolons.INVALID_AUTH_SCHEMEThe first part of the
Authorizationheader was not “HHMAC”.INCORRECT_ENCODINGThe body of the request is not encoded with the encoding specified in
Content-Encoding.Key path: None.
INVALID_JSONThe JSON specified in the request cannot be parsed as JSON.
Key path: None.
INVALID_RESOURCE_IDThe section URL has a section ID that is not a valid UUID.
Key path:
data.links.sections.#.INVALID_RESOURCE_TYPEThe path in the section URL does not start with
/sections/.Key path:
data.links.sections.#.INVALID_SCHEMEThe section URL must have the
httpsscheme.Key path:
data.links.sections.#.INVALID_TYPEThe value specified for
field_nameis not of the correct type for that field.Key path:
{field_name}.INVALID_URLThe section URL you specified is not a valid URL.
Key path:
data.links.sections.#.METHOD_NOT_ALLOWEDThe HTTP method you specified is not valid for this URL.
Key path: None.
DATE_NOT_RECENTThe date field specified in the
Authorizationheader was not within 5 minutes of the server’s time.MISSINGA required field is missing. The key path indicates the field that was not supplied in the request.
Key path: *
MISSING_API_KEY_IDThe key field was empty in the
Authorizationheader.MISSING_RESOURCE_IDThe section URL is missing the
section_idUUID.Key path:
data.links.sections.#.MISSING_SIGNATUREThe signature field was empty in the
Authorizationheader.MISSING_DATEThe date field was empty in the
Authorizationheader.MIME_PART_INVALID_SIZEThe
sizeparameter is not an integer greater than or equal to zero.NOT_ACCEPTABLEThe
Acceptheader, if specified, must allowapplication/json.Key path: None.
NOT_FOUNDThe endpoint you tried to access does not exist. Key path: None.
The resource you tried to access does not exist. Key path:
{resource_id}.
NOT_ALLOWEDThe section you specified does not belong to the given channel. Key path:
data.links.sections.#.Once an article has been published with
isPreviewset tofalse, the setting cannot be changed totrue.Key path:data.isPreview.
UNSUPPORTED_MEDIA_TYPEThe
Content-Typevalue specified is not supported by the specified endpoint.Key path: None.
UNSUPPORTED_ENCODINGThe encoding specified in
Content-TypeorContent-Transfer-Encodingis not supported.Key path: None.
UNAUTHORIZEDThe
Authorizationheader was not set.INVALID_API_KEY_FORMATThe
keyfield in theAuthorizationheader was not a UUID.DUPLICATE_ARTICLE_FOUNDAn article with the same title was published to the same channel within the last 24 hours.
DUPLICATE_AUTH_PARAMETERA parameter was supplied twice in the
Authorizationheader.INVALID_DATE_FORMATThe date field specified in the
Authorizationheader was not in ISO 8601 format.INVALID_DOCUMENTThe JSON in the Apple News Format document (
article.json) is invalid. Test with News Preview first.Key path: None.
INVALID_MIME_MULTIPARTThe request body cannot be parsed as valid MIME-multipart.
Key path: None.
MIME_PART_TOO_LARGEThe specified MIME part is larger than 20 MB. Key path:
{mime_part_name}MIME_PART_TOO_SLOWThe MIME part took too long to load from the request body. Key path:
{mime_part_name}MIME_PART_INCORRECT_SIZEThe
sizespecified does not match the actual size of the MIME part.FAILED_TO_PARSE_IMAGEThe image is either a bad image or has an invalid format.
ONLY_PREVIEW_ALLOWEDThis channel is currently only allowed to publish preview articles, but
isPreviewisfalse.Key path: None.
PUBLISHING_NOT_ALLOWEDThis channel is currently not allowed to publish articles.
Key path: None.
INVALID_ARTICLE_TERRITORYA country code for publishing or updating the article is invalid.
REQUEST_BODY_TOO_LARGEThe request body is too large. The maximum size allowed is 500 MB.
TOO_MANY_PREVIEW_ARTICLESMore than 500 articles are not allowed in
isPreviewmode.VIDEO_URL_NOT_ALLOWEDYour channel does not support
videoURLin articles.WRONG_REVISIONThe revision specified does not match the current revision, most likely because the article has been updated by another call.
Key path:
data.revision.WRONG_SIGNATUREThe
signaturefield given by the client did not match the signature computed by the server.