Upload a file
curl --request POST \
--url https://api.1-news.app/v1/projects/{projectId}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"dataBase64": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contentType: '<string>', dataBase64: '<string>', name: '<string>'})
};
fetch('https://api.1-news.app/v1/projects/{projectId}/media', 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}/media"
payload = {
"contentType": "<string>",
"dataBase64": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Gallery
Upload a file
POST /v1/projects//media uploads a gallery file. Send the file as base64 with its content type and name.
POST
/
v1
/
projects
/
{projectId}
/
media
Upload a file
curl --request POST \
--url https://api.1-news.app/v1/projects/{projectId}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"dataBase64": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contentType: '<string>', dataBase64: '<string>', name: '<string>'})
};
fetch('https://api.1-news.app/v1/projects/{projectId}/media', 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}/media"
payload = {
"contentType": "<string>",
"dataBase64": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Upload a file to the gallery. Accepted types are PNG, JPEG, WebP, GIF, SVG, and PDF. The file must be under 8 MB.