curl --request POST \
--url http://localhost:3000/v2/complaints/ \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"objectId": "507f1f77bcf86cd799439012",
"desc": "The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.",
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"roomDescription": "Bathroom on 2nd floor, next to the elevator",
"contactName": "John Smith",
"contact": {
"email": "john.smith@example.com",
"telephone": "+41 44 123 45 67"
},
"priority": 2,
"images": [
"https://example.com/complaint-image1.jpg"
],
"userId": "507f1f77bcf86cd799439014",
"customFields": {}
}
'import requests
url = "http://localhost:3000/v2/complaints/"
payload = {
"objectId": "507f1f77bcf86cd799439012",
"desc": "The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.",
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"roomDescription": "Bathroom on 2nd floor, next to the elevator",
"contactName": "John Smith",
"contact": {
"email": "john.smith@example.com",
"telephone": "+41 44 123 45 67"
},
"priority": 2,
"images": ["https://example.com/complaint-image1.jpg"],
"userId": "507f1f77bcf86cd799439014",
"customFields": {}
}
headers = {
"x-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
objectId: '507f1f77bcf86cd799439012',
desc: 'The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.',
_id: '<string>',
number: 123,
companyId: '<string>',
status: {
status: 123,
createdAt: '2023-11-07T05:31:56Z',
createdBy: '<string>',
lastModifiedAt: '2023-11-07T05:31:56Z',
lastModifiedBy: '<string>'
},
chatId: '<string>',
roomDescription: 'Bathroom on 2nd floor, next to the elevator',
contactName: 'John Smith',
contact: {email: 'john.smith@example.com', telephone: '+41 44 123 45 67'},
priority: 2,
images: ['https://example.com/complaint-image1.jpg'],
userId: '507f1f77bcf86cd799439014',
customFields: {}
})
};
fetch('http://localhost:3000/v2/complaints/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/complaints/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'objectId' => '507f1f77bcf86cd799439012',
'desc' => 'The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.',
'_id' => '<string>',
'number' => 123,
'companyId' => '<string>',
'status' => [
'status' => 123,
'createdAt' => '2023-11-07T05:31:56Z',
'createdBy' => '<string>',
'lastModifiedAt' => '2023-11-07T05:31:56Z',
'lastModifiedBy' => '<string>'
],
'chatId' => '<string>',
'roomDescription' => 'Bathroom on 2nd floor, next to the elevator',
'contactName' => 'John Smith',
'contact' => [
'email' => 'john.smith@example.com',
'telephone' => '+41 44 123 45 67'
],
'priority' => 2,
'images' => [
'https://example.com/complaint-image1.jpg'
],
'userId' => '507f1f77bcf86cd799439014',
'customFields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-API-Key: <api-key>"
],
]);
$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 := "http://localhost:3000/v2/complaints/"
payload := strings.NewReader("{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v2/complaints/")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/complaints/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"desc": "Updated complaint description with additional details",
"roomDescription": "Updated room location information",
"contactName": "John Smith Jr.",
"contact": {
"email": "jsmith@example.com",
"telephone": "<string>"
},
"priority": 3,
"images": [
"<string>"
],
"userId": "507f1f77bcf86cd799439014",
"comment": "Additional notes about the complaint resolution",
"response": "Thank you for your patience. The issue has been resolved.",
"customFields": {}
}Create Ticket
Create a new complaint.
curl --request POST \
--url http://localhost:3000/v2/complaints/ \
--header 'Content-Type: application/json' \
--header 'x-API-Key: <api-key>' \
--data '
{
"objectId": "507f1f77bcf86cd799439012",
"desc": "The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.",
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"roomDescription": "Bathroom on 2nd floor, next to the elevator",
"contactName": "John Smith",
"contact": {
"email": "john.smith@example.com",
"telephone": "+41 44 123 45 67"
},
"priority": 2,
"images": [
"https://example.com/complaint-image1.jpg"
],
"userId": "507f1f77bcf86cd799439014",
"customFields": {}
}
'import requests
url = "http://localhost:3000/v2/complaints/"
payload = {
"objectId": "507f1f77bcf86cd799439012",
"desc": "The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.",
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"roomDescription": "Bathroom on 2nd floor, next to the elevator",
"contactName": "John Smith",
"contact": {
"email": "john.smith@example.com",
"telephone": "+41 44 123 45 67"
},
"priority": 2,
"images": ["https://example.com/complaint-image1.jpg"],
"userId": "507f1f77bcf86cd799439014",
"customFields": {}
}
headers = {
"x-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
objectId: '507f1f77bcf86cd799439012',
desc: 'The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.',
_id: '<string>',
number: 123,
companyId: '<string>',
status: {
status: 123,
createdAt: '2023-11-07T05:31:56Z',
createdBy: '<string>',
lastModifiedAt: '2023-11-07T05:31:56Z',
lastModifiedBy: '<string>'
},
chatId: '<string>',
roomDescription: 'Bathroom on 2nd floor, next to the elevator',
contactName: 'John Smith',
contact: {email: 'john.smith@example.com', telephone: '+41 44 123 45 67'},
priority: 2,
images: ['https://example.com/complaint-image1.jpg'],
userId: '507f1f77bcf86cd799439014',
customFields: {}
})
};
fetch('http://localhost:3000/v2/complaints/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v2/complaints/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'objectId' => '507f1f77bcf86cd799439012',
'desc' => 'The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.',
'_id' => '<string>',
'number' => 123,
'companyId' => '<string>',
'status' => [
'status' => 123,
'createdAt' => '2023-11-07T05:31:56Z',
'createdBy' => '<string>',
'lastModifiedAt' => '2023-11-07T05:31:56Z',
'lastModifiedBy' => '<string>'
],
'chatId' => '<string>',
'roomDescription' => 'Bathroom on 2nd floor, next to the elevator',
'contactName' => 'John Smith',
'contact' => [
'email' => 'john.smith@example.com',
'telephone' => '+41 44 123 45 67'
],
'priority' => 2,
'images' => [
'https://example.com/complaint-image1.jpg'
],
'userId' => '507f1f77bcf86cd799439014',
'customFields' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-API-Key: <api-key>"
],
]);
$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 := "http://localhost:3000/v2/complaints/"
payload := strings.NewReader("{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v2/complaints/")
.header("x-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v2/complaints/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"objectId\": \"507f1f77bcf86cd799439012\",\n \"desc\": \"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.\",\n \"_id\": \"<string>\",\n \"number\": 123,\n \"companyId\": \"<string>\",\n \"status\": {\n \"status\": 123,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"createdBy\": \"<string>\",\n \"lastModifiedAt\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedBy\": \"<string>\"\n },\n \"chatId\": \"<string>\",\n \"roomDescription\": \"Bathroom on 2nd floor, next to the elevator\",\n \"contactName\": \"John Smith\",\n \"contact\": {\n \"email\": \"john.smith@example.com\",\n \"telephone\": \"+41 44 123 45 67\"\n },\n \"priority\": 2,\n \"images\": [\n \"https://example.com/complaint-image1.jpg\"\n ],\n \"userId\": \"507f1f77bcf86cd799439014\",\n \"customFields\": {}\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"number": 123,
"companyId": "<string>",
"status": {
"status": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
},
"chatId": "<string>",
"desc": "Updated complaint description with additional details",
"roomDescription": "Updated room location information",
"contactName": "John Smith Jr.",
"contact": {
"email": "jsmith@example.com",
"telephone": "<string>"
},
"priority": 3,
"images": [
"<string>"
],
"userId": "507f1f77bcf86cd799439014",
"comment": "Additional notes about the complaint resolution",
"response": "Thank you for your patience. The issue has been resolved.",
"customFields": {}
}Authorizations
Body
Complaint creation data
Data required to create a new complaint
ID of the customer object this complaint relates to
"507f1f77bcf86cd799439012"
Detailed description of the complaint or issue
"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture."
Unique identifier of the entity
Unique number of the entity, used for identification
The ID of the company this entity belongs to
Entity Status information
Show child attributes
Show child attributes
ID of the chat associated with this entity
Description of the specific room or area where the issue occurred
"Bathroom on 2nd floor, next to the elevator"
Name of the person submitting the complaint
"John Smith"
Contact information for the complaint reporter
Show child attributes
Show child attributes
Priority level of the complaint (1=Low, 2=Medium, 3=High, 4=Critical)
1 <= x <= 42
Images related to the complaint (evidence, before photos, etc.)
["https://example.com/complaint-image1.jpg"]
ID of the user to assign this complaint to (optional)
"507f1f77bcf86cd799439014"
Custom field values for this complaint
Response
Complaint created successfully
Data that can be updated for an existing complaint
Unique identifier of the entity
Unique number of the entity, used for identification
The ID of the company this entity belongs to
Entity Status information
Show child attributes
Show child attributes
ID of the chat associated with this entity
Updated description of the complaint
"Updated complaint description with additional details"
Updated room description
"Updated room location information"
Updated contact name
"John Smith Jr."
Updated contact information
Show child attributes
Show child attributes
Updated priority level (1=Low, 2=Medium, 3=High, 4=Critical)
1 <= x <= 43
Updated images for the complaint
ID of the user to assign/reassign this complaint to
"507f1f77bcf86cd799439014"
Internal comment about the complaint
"Additional notes about the complaint resolution"
Customer response message
"Thank you for your patience. The issue has been resolved."
Updated custom field values
Was this page helpful?

