curl --request POST \
--url https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form attachment='@example-file'import requests
url = "https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment"
files = { "attachment": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('attachment', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment', 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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment",
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=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "tic_abc12345def678",
"customerId": "cst_abc12354678",
"title": "Invoice issue",
"source": "portal",
"status": "open",
"messages": [
{
"id": "tim_abc12345def678",
"postedBy": "John Appleseed",
"isPostedByCustomer": true,
"message": "<p>Hello, help me with my invoice please</p>",
"postedAt": "2024-04-29T21:00:00+02:00",
"attachments": [
{
"id": "tma_abc12345def678",
"name": "Screenshot.png",
"size": 1256,
"mime": "image/png"
}
]
}
],
"createdAt": "2024-04-29T21:00:00+02:00"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Upload attachment to Ticket message
Add an attachment to an already posted Ticket message. Adding an attachment is only possible in the first 5 minutes after creating the message. Chat conversations do not support attachments.
curl --request POST \
--url https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form attachment='@example-file'import requests
url = "https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment"
files = { "attachment": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('attachment', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment', 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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment",
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=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mijnklantportaal.nl/v1/tickets/{ticketId}/message/{messageId}/attachment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachment\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "tic_abc12345def678",
"customerId": "cst_abc12354678",
"title": "Invoice issue",
"source": "portal",
"status": "open",
"messages": [
{
"id": "tim_abc12345def678",
"postedBy": "John Appleseed",
"isPostedByCustomer": true,
"message": "<p>Hello, help me with my invoice please</p>",
"postedAt": "2024-04-29T21:00:00+02:00",
"attachments": [
{
"id": "tma_abc12345def678",
"name": "Screenshot.png",
"size": 1256,
"mime": "image/png"
}
]
}
],
"createdAt": "2024-04-29T21:00:00+02:00"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the ticket record
ID of the ticket message record
Body
The file you want to upload
Response
The attachment is uploaded and posted
Ticket record with the messages
ID of the Webhook record, always starting with tic_.
"tic_abc12345def678"
ID of the Customer this ticket belongs to
"cst_abc12354678"
Title of the ticket, mostly describing the ticket
"Invoice issue"
Source of the ticket. Can be portal, email or chat.
"portal"
Current status of the ticket. Can be open or closed.
"open"
An array with the messages in this ticket
Show child attributes
Show child attributes
Date and time when the ticket was created, written in ATOM format.
"2024-04-29T21:00:00+02:00"
