Upload attachments for imported ticket
curl --request POST \
--url https://api.helpdesk.com/v1/importedTickets/attachments \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form transactionID=42e113f9-9353-4e89-9f68-69b92f423b0c \
--form 'attachments=<string>' \
--form attachments.items='@example-file'import requests
url = "https://api.helpdesk.com/v1/importedTickets/attachments"
files = { "attachments.items": ("example-file", open("example-file", "rb")) }
payload = {
"transactionID": "42e113f9-9353-4e89-9f68-69b92f423b0c",
"attachments": "<string>"
}
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('transactionID', '42e113f9-9353-4e89-9f68-69b92f423b0c');
form.append('attachments', '<string>');
form.append('attachments.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.helpdesk.com/v1/importedTickets/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.helpdesk.com/v1/importedTickets/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.helpdesk.com/v1/importedTickets/attachments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.helpdesk.com/v1/importedTickets/attachments")
.header("Authorization", "Basic <encoded-value>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpdesk.com/v1/importedTickets/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431282"
},
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431283"
}
]Imported tickets
Upload attachments for imported ticket
Uploads attachments for imported ticket. Attachments are required for ticket creation with attachments.
Use multipart with attachments as key. Multiple files are allowed.
POST
/
v1
/
importedTickets
/
attachments
Upload attachments for imported ticket
curl --request POST \
--url https://api.helpdesk.com/v1/importedTickets/attachments \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form transactionID=42e113f9-9353-4e89-9f68-69b92f423b0c \
--form 'attachments=<string>' \
--form attachments.items='@example-file'import requests
url = "https://api.helpdesk.com/v1/importedTickets/attachments"
files = { "attachments.items": ("example-file", open("example-file", "rb")) }
payload = {
"transactionID": "42e113f9-9353-4e89-9f68-69b92f423b0c",
"attachments": "<string>"
}
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('transactionID', '42e113f9-9353-4e89-9f68-69b92f423b0c');
form.append('attachments', '<string>');
form.append('attachments.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
options.body = form;
fetch('https://api.helpdesk.com/v1/importedTickets/attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.helpdesk.com/v1/importedTickets/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.helpdesk.com/v1/importedTickets/attachments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.helpdesk.com/v1/importedTickets/attachments")
.header("Authorization", "Basic <encoded-value>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpdesk.com/v1/importedTickets/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"transactionID\"\r\n\r\n42e113f9-9353-4e89-9f68-69b92f423b0c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431282"
},
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431283"
}
]Authorizations
PersonalAccessTokenBearerAuth
Use your account ID as the username and your personal access token (PAT) as the password, or pass a Base64-encoded value directly in the Authorization header. For more information, see the personal access tokens guide.
Body
multipart/form-data
Response
200 - application/json
Successful response.
Unique object identifier
Example:
"42e113f9-9353-4e89-9f68-69b92f423b0c"
Example:
[
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431282"
},
{
"attachmentID": "58ceb2d5-4bc9-483b-b2a9-456164431283"
}
]
Was this page helpful?
⌘I