curl --location --request POST 'https://api.stateset.com/v1/response' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
}'
mutation InsertNewResponse(
$response: responses_insert_input!
) {
insert_responses (
objects: [$response]
) {
returning {
id
ticket_url
channel
customer_message
agent_response
rating
agent_take_over
served_by_agent
org_id
created_date
ticket_id
function_call
workflow_id
}
}
}`;
const response = await stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
{
"response": [
{
"id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"ticket_url": "https://api.stateset.com/v1/ticket",
"channel": "Email",
"customer_message": "I would like to cancel my order",
"agent_response": "Your order has been cancelled. Thank you!",
"rating": "5",
"agent_take_over": false,
"served_by_agent": true,
"org_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"created_date": "2023-06-28T19:34:59.189838+00:00",
"ticket_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"function_call": "cancel-order",
"workflow_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
}
]
}
Create Response
This endpoint creates a new response from the agent
POST
/
v1
/
response
curl --location --request POST 'https://api.stateset.com/v1/response' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
}'
mutation InsertNewResponse(
$response: responses_insert_input!
) {
insert_responses (
objects: [$response]
) {
returning {
id
ticket_url
channel
customer_message
agent_response
rating
agent_take_over
served_by_agent
org_id
created_date
ticket_id
function_call
workflow_id
}
}
}`;
const response = await stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
{
"response": [
{
"id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"ticket_url": "https://api.stateset.com/v1/ticket",
"channel": "Email",
"customer_message": "I would like to cancel my order",
"agent_response": "Your order has been cancelled. Thank you!",
"rating": "5",
"agent_take_over": false,
"served_by_agent": true,
"org_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"created_date": "2023-06-28T19:34:59.189838+00:00",
"ticket_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"function_call": "cancel-order",
"workflow_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
}
]
}
Body
string
This is the unique identifier for the response
string
This is the unique identifier for the ticket url.
string
This is the unique identifier for the channel
string
This is the customer message.
string
This is the agent response.
string
This is the reported condition of the return.
boolean
This is whethere the message added the agent_take_over tag.
boolean
This is whether the request was served by an agent.
string
This is the org_id of the response.
string
This is the created date of the response.
string
This is the ticket id of the response.
string
This is the function call of the response.
string
This is the workflow id of the response.
Response
string
The ID provided in the data tab may be used to identify the return
string
The ticket url provided in the data tab may be used to identify the return
string
The channel provided in the data tab may be used to identify the return
string
The customer message provided in the data tab may be used to identify the return
string
The agent response provided in the data tab may be used to identify the return
string
The rating provided in the data tab may be used to identify the return
boolean
The agent take over provided in the data tab may be used to identify the return
boolean
The served by agent provided in the data tab may be used to identify the return
string
The org id provided in the data tab may be used to identify the return
string
The created date provided in the data tab may be used to identify the return
string
The ticket id provided in the data tab may be used to identify the return
string
The function call provided in the data tab may be used to identify the return
string
The workflow id provided in the data tab may be used to identify the return
curl --location --request POST 'https://api.stateset.com/v1/response' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
}'
mutation InsertNewResponse(
$response: responses_insert_input!
) {
insert_responses (
objects: [$response]
) {
returning {
id
ticket_url
channel
customer_message
agent_response
rating
agent_take_over
served_by_agent
org_id
created_date
ticket_id
function_call
workflow_id
}
}
}`;
const response = await stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
response = stateset.response.create({
'id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'ticket_url': 'https://api.stateset.com/v1/ticket',
'channel': 'Email',
'customer_message': 'I would like to cancel my order',
'agent_response': 'Your order has been cancelled. Thank you!',
'rating': '5',
'agent_take_over': false,
'served_by_agent': true,
'org_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'created_date': '2023-06-28T19:34:59.189838+00:00',
'ticket_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
'function_call': 'cancel-order',
'workflow_id': '0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
})
{
"response": [
{
"id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"ticket_url": "https://api.stateset.com/v1/ticket",
"channel": "Email",
"customer_message": "I would like to cancel my order",
"agent_response": "Your order has been cancelled. Thank you!",
"rating": "5",
"agent_take_over": false,
"served_by_agent": true,
"org_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"created_date": "2023-06-28T19:34:59.189838+00:00",
"ticket_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"function_call": "cancel-order",
"workflow_id": "0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
}
]
}
⌘I