Create a new ticket draft
curl --request POST \
--url https://platform.thena.ai/v1/tickets/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"requestorEmail": "<string>",
"teamId": "<string>",
"draftScope": "personal",
"assignedAgentId": "<string>",
"description": "<string>",
"submitterEmail": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"typeId": "<string>",
"isPrivate": true,
"attachmentUrls": [
"<string>"
],
"customFieldValues": [
{}
],
"metadata": {},
"accountId": "<string>"
}
'import requests
url = "https://platform.thena.ai/v1/tickets/draft"
payload = {
"title": "<string>",
"requestorEmail": "<string>",
"teamId": "<string>",
"draftScope": "personal",
"assignedAgentId": "<string>",
"description": "<string>",
"submitterEmail": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"typeId": "<string>",
"isPrivate": True,
"attachmentUrls": ["<string>"],
"customFieldValues": [{}],
"metadata": {},
"accountId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
requestorEmail: '<string>',
teamId: '<string>',
draftScope: 'personal',
assignedAgentId: '<string>',
description: '<string>',
submitterEmail: '<string>',
statusId: '<string>',
priorityId: '<string>',
typeId: '<string>',
isPrivate: true,
attachmentUrls: ['<string>'],
customFieldValues: [{}],
metadata: {},
accountId: '<string>'
})
};
fetch('https://platform.thena.ai/v1/tickets/draft', 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://platform.thena.ai/v1/tickets/draft",
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([
'title' => '<string>',
'requestorEmail' => '<string>',
'teamId' => '<string>',
'draftScope' => 'personal',
'assignedAgentId' => '<string>',
'description' => '<string>',
'submitterEmail' => '<string>',
'statusId' => '<string>',
'priorityId' => '<string>',
'typeId' => '<string>',
'isPrivate' => true,
'attachmentUrls' => [
'<string>'
],
'customFieldValues' => [
[
]
],
'metadata' => [
],
'accountId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platform.thena.ai/v1/tickets/draft"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://platform.thena.ai/v1/tickets/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/tickets/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uid": "<string>",
"status": "<string>",
"draftScope": "<string>",
"entityType": "<string>",
"content": {},
"metadata": {},
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
}Create a new ticket draft
POST
/
v1
/
tickets
/
draft
Create a new ticket draft
curl --request POST \
--url https://platform.thena.ai/v1/tickets/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"requestorEmail": "<string>",
"teamId": "<string>",
"draftScope": "personal",
"assignedAgentId": "<string>",
"description": "<string>",
"submitterEmail": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"typeId": "<string>",
"isPrivate": true,
"attachmentUrls": [
"<string>"
],
"customFieldValues": [
{}
],
"metadata": {},
"accountId": "<string>"
}
'import requests
url = "https://platform.thena.ai/v1/tickets/draft"
payload = {
"title": "<string>",
"requestorEmail": "<string>",
"teamId": "<string>",
"draftScope": "personal",
"assignedAgentId": "<string>",
"description": "<string>",
"submitterEmail": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"typeId": "<string>",
"isPrivate": True,
"attachmentUrls": ["<string>"],
"customFieldValues": [{}],
"metadata": {},
"accountId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
requestorEmail: '<string>',
teamId: '<string>',
draftScope: 'personal',
assignedAgentId: '<string>',
description: '<string>',
submitterEmail: '<string>',
statusId: '<string>',
priorityId: '<string>',
typeId: '<string>',
isPrivate: true,
attachmentUrls: ['<string>'],
customFieldValues: [{}],
metadata: {},
accountId: '<string>'
})
};
fetch('https://platform.thena.ai/v1/tickets/draft', 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://platform.thena.ai/v1/tickets/draft",
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([
'title' => '<string>',
'requestorEmail' => '<string>',
'teamId' => '<string>',
'draftScope' => 'personal',
'assignedAgentId' => '<string>',
'description' => '<string>',
'submitterEmail' => '<string>',
'statusId' => '<string>',
'priorityId' => '<string>',
'typeId' => '<string>',
'isPrivate' => true,
'attachmentUrls' => [
'<string>'
],
'customFieldValues' => [
[
]
],
'metadata' => [
],
'accountId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platform.thena.ai/v1/tickets/draft"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://platform.thena.ai/v1/tickets/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/tickets/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"requestorEmail\": \"<string>\",\n \"teamId\": \"<string>\",\n \"draftScope\": \"personal\",\n \"assignedAgentId\": \"<string>\",\n \"description\": \"<string>\",\n \"submitterEmail\": \"<string>\",\n \"statusId\": \"<string>\",\n \"priorityId\": \"<string>\",\n \"typeId\": \"<string>\",\n \"isPrivate\": true,\n \"attachmentUrls\": [\n \"<string>\"\n ],\n \"customFieldValues\": [\n {}\n ],\n \"metadata\": {},\n \"accountId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uid": "<string>",
"status": "<string>",
"draftScope": "<string>",
"entityType": "<string>",
"content": {},
"metadata": {},
"createdBy": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastModifiedBy": "<string>"
}Authorizations
Enter the bearer token
Body
application/json
The title of the ticket
The email of the requestor
The ID of the team
The scope of the draft
Available options:
personal, team The ID of the assigned agent
The description of the ticket
The email of the submitter
The ID of the status
The ID of the priority
The ID of the type
Whether the ticket is private
The attachment URLs
The custom field values
Additional metadata for the draft
The ID of the account