curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/attachments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/diagram.png',
content_base64: '<string>',
filename: 'diagram.png',
content_type: 'image/png'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/attachments"
payload = {
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "abcd1234efgh5678ijkl",
"filename": "logo.png",
"content_type": "image/png",
"byte_size": 20480,
"checksum": "Y2hlY2tzdW0xMjM0NQ==",
"created_at": "2023-11-07T05:31:56Z",
"service_name": "amazon",
"signed_id": "<string>",
"blob_url": "https://spinkart.neetokb.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/logo.png",
"attachable_html": "<string>"
}{
"error": "File size exceeds the maximum limit of 50 MB."
}Upload attachment
Upload a file (such as an image, PDF, or document) and get back a link you can use inside an article, so you don’t have to embed the full file directly in the article’s content, which makes articles large and slow to load. Send the file as multipart file, or send a JSON body with either a public https url or content_base64 with filename. For CLI sessions, this needs the Modify articles permission. For images, the response also includes attachable_html: the image already formatted as ready-to-paste code that you can add straight into the article’s html_content. Any file you upload but never use in an article is removed automatically.
curl --request POST \
--url https://{your-subdomain}.neetokb.com/api/external/v2/attachments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/diagram.png',
content_base64: '<string>',
filename: 'diagram.png',
content_type: 'image/png'
})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/attachments"
payload = {
"url": "https://example.com/diagram.png",
"content_base64": "<string>",
"filename": "diagram.png",
"content_type": "image/png"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "abcd1234efgh5678ijkl",
"filename": "logo.png",
"content_type": "image/png",
"byte_size": 20480,
"checksum": "Y2hlY2tzdW0xMjM0NQ==",
"created_at": "2023-11-07T05:31:56Z",
"service_name": "amazon",
"signed_id": "<string>",
"blob_url": "https://spinkart.neetokb.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/logo.png",
"attachable_html": "<string>"
}{
"error": "File size exceeds the maximum limit of 50 MB."
}file, or send a JSON body with a public url or content_base64 and filename.
{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
Give exactly one source, either url or content_base64 with filename.
Response
Created - File uploaded successfully