Create a story
curl --request POST \
--url https://api.1-news.app/v1/projects/{projectId}/articles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"blocks": [
{}
],
"coverUrl": "<string>",
"coverAlt": "<string>",
"seoTitle": "<string>",
"seoDescription": "<string>",
"keywords": [
{}
],
"categories": [
{}
],
"tags": [
{}
],
"action": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
excerpt: '<string>',
blocks: [{}],
coverUrl: '<string>',
coverAlt: '<string>',
seoTitle: '<string>',
seoDescription: '<string>',
keywords: [{}],
categories: [{}],
tags: [{}],
action: '<string>'
})
};
fetch('https://api.1-news.app/v1/projects/{projectId}/articles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.1-news.app/v1/projects/{projectId}/articles"
payload = {
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"blocks": [{}],
"coverUrl": "<string>",
"coverAlt": "<string>",
"seoTitle": "<string>",
"seoDescription": "<string>",
"keywords": [{}],
"categories": [{}],
"tags": [{}],
"action": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"slug": "<string>"
}Stories
Create a story
POST /v1/projects//articles creates a story. Send a title, and set action to publish when it should go live.
POST
/
v1
/
projects
/
{projectId}
/
articles
Create a story
curl --request POST \
--url https://api.1-news.app/v1/projects/{projectId}/articles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"blocks": [
{}
],
"coverUrl": "<string>",
"coverAlt": "<string>",
"seoTitle": "<string>",
"seoDescription": "<string>",
"keywords": [
{}
],
"categories": [
{}
],
"tags": [
{}
],
"action": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
excerpt: '<string>',
blocks: [{}],
coverUrl: '<string>',
coverAlt: '<string>',
seoTitle: '<string>',
seoDescription: '<string>',
keywords: [{}],
categories: [{}],
tags: [{}],
action: '<string>'
})
};
fetch('https://api.1-news.app/v1/projects/{projectId}/articles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.1-news.app/v1/projects/{projectId}/articles"
payload = {
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"blocks": [{}],
"coverUrl": "<string>",
"coverAlt": "<string>",
"seoTitle": "<string>",
"seoDescription": "<string>",
"keywords": [{}],
"categories": [{}],
"tags": [{}],
"action": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"slug": "<string>"
}Create a story in a newsroom you can edit. Send
action as publish to publish it in the same call. Otherwise it is saved as a draft.