Update an Article
Update an existing article in your channel.
URL
POST https://news-api.apple.com/articles/{articleId}Path Parameters
| Name | Type | Description |
|---|---|---|
articleId Required | string | The UUID or the Share URL ID of the article you want to update. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | ArticleResponse |
|
| 202 | Accepted Content-Type: application/json | ArticleResponse | The Apple News team optimized the article, so your updates weren’t applied. Contact your Apple News technical representative if you need to make updates. |
| 400 | Bad Request Content-Type: application/json | Error |
|
| 401 | Unauthorized Content-Type: application/json | Error | You didn’t include the |
| 403 | Forbidden Content-Type: application/json | Error | You tried to access a channel your API key doesn’t have permission to access. Key path: None. |
| 404 | Not Found Content-Type: application/json | Error |
|
| 409 | Conflict Content-Type: application/json | Error | The revision specified doesn’t match the current revision, most likely because another call updated the article. Key path: |
| 429 | Too Many Requests Content-Type: application/json | Error | You exceeded the number of articles that you can update within the specific time window. The response header |
Mentioned in
Discussion
The Update an Article endpoint accepts a MIME multipart request, in multipart/form-data format, instead of JSON (application/json). In contrast to the Create an Article request, all parts of an Update an Article request are optional except for the metadata section. The Update an Article request may also include the article’s Apple News Format document or any of the resources referenced in the document with a bundle:// URL, each with its own MIME part.
For example, you can update a single image, the document text or layout, the metadata, or all of them at once. Other than the option to omit parts, the format of the Update an Article request is identical to the Create an Article request. Although you can omit MIME parts that you previously posted, you can’t partially update the Apple News Format document in the article.json. You can only replace it, not patch it.
If you remove a resource part in one update call and later decide you want to reference it in the article, you must upload the resource again (not just restore the reference).
Updating an article doesn’t change the timestamp of the article or its placement in your feeds, such as the Today feed, channel feeds, and topic feeds.
Here are the guidelines for updating an existing article:
For each update, provide the article ID and the
revisiontoken that matches the current revision of the article. This ensures that two users can’t update an article at the same time and lose data. If this happens, the client informs the second user (via theWRONG_REVISIONerror) that the specified revision was incorrect because the article was updated in the meantime. The second user must retrieve the new version before proceeding. The client can then attempt to merge the two versions and call Update an Article again, or can choose to overwrite the older version with the new version. To get the current revision, use the method call shown in Read Article Information, or use a revision ID from an earlier Create an Article or Update an Article call.You must wrap all metadata fields in a data key. See “Example Code for Updating an Article with Metadata” below. The server returns the
INVALID_JSONerror if there is no data key in the request call.Include
isPreviewin the metadata to allow an update call to change the article’s preview/published state. Additionally, on update, you can make a preview article public (changetruetofalse), but you can’t set a currently public article back to a preview state (changefalsetotrue).Use the
isHiddenproperty in the metadata to hide and unhide an article in the Update an Article request.
Example Code for Updating an Article Without Metadata
Example Code for Updating an Article with Metadata
HTTP Body
The article’s Apple News Format JSON document and other assets, like PDFs, images, and fonts.