Create an Article
Publish an article to your channel.
URL
POST https://news-api.apple.com/channels/{channelId}/articlesPath Parameters
| Name | Type | Description |
|---|---|---|
channelId Required | string | The UUID of the channel to publish the article to. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 201 | Created Content-Type: application/json | ArticleResponse |
|
| 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 |
|
| 429 | Too Many Requests Content-Type: application/json | Error | You exceeded the number of articles that can be published within the allowed time window. The response header |
Mentioned in
Discussion
Use the Create an Article endpoint to publish an article to your channel.
Here are the guidelines for Apple News Format documents and resources:
A Create an Article request must consist of at least one
MIMEpart that contains the article’s Apple News Format document. This part must have filename set toarticle.json. See “Example Code for Creating an Article Without Metadata” below.The server requires additional parts for each resource referenced in the Apple News Format document that uses a
URLin this format:bundle:// URL.Each part must have a
Content-Dispositionheader. The disposition must be form-data, and you must specify the filename parameter ofContent-Disposition.In resource parts, the filename parameter must match the path of the
bundle://URLin the Apple News Format document that references this file. For example, if the document references a URL ofbundle://logo.png, there must be aMIMEpart with filename set tologo.png. For resource parts, the valid values forContent-Typeareimage/jpeg,image/png,image/gif, andapplication/octet-stream.When using a remote image, the URL must be in
http://orhttps://format. No additional parts are required in the URL for remote images.
See Apple News API Tutorial to learn how to publish an article using the Apple News API.
Here are the guidelines for Apple News Format metadata:
You can include an optional metadata part to provide additional non–Apple News Format data about the article, such as
isSponsoredandmaturityRating. See Create Article Metadata Fields. The metadata part can also specify any sections for the article by URL.You must wrap all metadata fields in a data key. See “Example Code for Creating an Article with Metadata” below_._ The
INVALID_JSONerror is thrown if there is nodatakey in the request call.
Here are the guidelines for Apple News Format sections:
To publish the article to the channel’s default section, omit
links.sections.To get information about a specific section, such as the section ID, use the Read Section Information endpoint.
To publish a standalone article outside of sections, set
sectionsto[](an empty array). Standalone articles don’t appear in your channel, but still appear in topics and search results, and may appear in For You.
Here are general guidelines for Apple News Format:
For articles with a source URL or thumbnail, avoid posting more than one article on the same channel using the same title, source URL, or thumbnail, within a 24-hour period. An article is considered a duplicate if these conditions are met.
For articles without a source URL and thumbnail, avoid posting more than one article on same channel, using the same title, within a 24-hour period. An article is considered a duplicate if these conditions are met.
When you create an article, be sure to retain the article ID or the self URL that’s returned in the response. You need the article ID to read, update, and delete an article.
To publish older articles, use the metadata properties in Apple News Format. If you set an older publication date, the article appears earlier in the feed. See Metadata in Apple News Format documentation. Articles are sorted by publication date.
A canonical URL is required to do data collection and reporting for comScore analytics.
Don’t change the canonical URL of the article after it has been set.
Example Code for Creating an Article Without Metadata
Example Code for Creating an Article with Metadata
HTTP Body
The article’s Apple News Format JSON document and other assets, like PDFs, images, and fonts.