This imports an attachment into the file system and creates a link to the file in the task with the given task ID.
curl -X POST "https://api.example.com/restapi/v1/attachment/crm/123/John Doe" \
-H "Content-Type: application/octet-stream"
import requests
import json
url = "https://api.example.com/restapi/v1/attachment/crm/123/John Doe"
headers = {
"Content-Type": "application/octet-stream"
}
response = requests.post(url, headers=headers)
print(response.json())
const response = await fetch("https://api.example.com/restapi/v1/attachment/crm/123/John Doe", {
method: "POST",
headers: {
"Content-Type": "application/octet-stream"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("POST", "https://api.example.com/restapi/v1/attachment/crm/123/John Doe", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/octet-stream")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/restapi/v1/attachment/crm/123/John Doe')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/octet-stream'
response = http.request(request)
puts response.body
[
{
"path": "example_string"
}
]
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Error",
"message": "Method not allowed",
"code": 405
}
{
"error": "Error",
"message": "Unsupported Media Type",
"code": 415
}
POST
/attachment/crm/{taskId}/{filename}POST
Base URLstring
Target server for requests. Edit to use your own host.
path
taskIdinteger
RequiredID of the task.
path
filenamestring
RequiredThe name of the attachment.
Content-Typestring
RequiredThe media type of the request body
Options: application/octet-stream
Request Preview
Response
Response will appear here after sending the request
Path Parameters
taskIdinteger
RequiredID of the task.
filenamestring
RequiredThe name of the attachment.
Responses
pathstring
Was this page helpful?