curl --request POST \
--url https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data @- <<EOF
{
"externalConversationId": "id-1389",
"eventId": "eventId-1388",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group59",
"groupName": "groupXYZ",
"agentRoutingCode": "route-13988",
"campaign": "campaign-A",
"deviceType": "TABLET",
"platform": "IOS",
"companySegment": [
"Sales",
"Marketing"
],
"companySubdivision": "operating",
"businessRule": "Apply customer's discount",
"entryType": "reactive",
"operatingSystem": "MAC_OS",
"browserType": "Safari",
"browserVersion": "14.1.2",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
}
EOFimport requests
url = "https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata"
payload = {
"externalConversationId": "id-1389",
"eventId": "eventId-1388",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group59",
"groupName": "groupXYZ",
"agentRoutingCode": "route-13988",
"campaign": "campaign-A",
"deviceType": "TABLET",
"platform": "IOS",
"companySegment": ["Sales", "Marketing"],
"companySubdivision": "operating",
"businessRule": "Apply customer's discount",
"entryType": "reactive",
"operatingSystem": "MAC_OS",
"browserType": "Safari",
"browserVersion": "14.1.2",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
}
headers = {
"asapp-api-id": "<api-key>",
"asapp-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'asapp-api-id': '<api-key>',
'asapp-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalConversationId: 'id-1389',
eventId: 'eventId-1388',
lobId: '1038',
lobName: 'manufacturing',
groupId: 'group59',
groupName: 'groupXYZ',
agentRoutingCode: 'route-13988',
campaign: 'campaign-A',
deviceType: 'TABLET',
platform: 'IOS',
companySegment: ['Sales', 'Marketing'],
companySubdivision: 'operating',
businessRule: 'Apply customer\'s discount',
entryType: 'reactive',
operatingSystem: 'MAC_OS',
browserType: 'Safari',
browserVersion: '14.1.2',
attributes: [
{name: 'attr1_name', value: 'attr1_value'},
{name: 'attr2_name', value: 'attr2_value'}
]
})
};
fetch('https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata', 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.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata",
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([
'externalConversationId' => 'id-1389',
'eventId' => 'eventId-1388',
'lobId' => '1038',
'lobName' => 'manufacturing',
'groupId' => 'group59',
'groupName' => 'groupXYZ',
'agentRoutingCode' => 'route-13988',
'campaign' => 'campaign-A',
'deviceType' => 'TABLET',
'platform' => 'IOS',
'companySegment' => [
'Sales',
'Marketing'
],
'companySubdivision' => 'operating',
'businessRule' => 'Apply customer\'s discount',
'entryType' => 'reactive',
'operatingSystem' => 'MAC_OS',
'browserType' => 'Safari',
'browserVersion' => '14.1.2',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
],
[
'name' => 'attr2_name',
'value' => 'attr2_value'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"asapp-api-id: <api-key>",
"asapp-api-secret: <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 := "https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata"
payload := strings.NewReader("{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("asapp-api-id", "<api-key>")
req.Header.Add("asapp-api-secret", "<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("https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["asapp-api-id"] = '<api-key>'
request["asapp-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": {
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
}
}{
"result": {
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "401-01",
"message": "Unauthorized"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "403-01",
"message": "Forbidden Response"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "404-01",
"message": "Not Found"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "409-01",
"message": "Conflict"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "413-01",
"message": "Request Entity Too Large"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "422-01",
"message": "Unprocessable Entity"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "429-01",
"message": "Too Many Requests"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "503-01",
"message": "Service Unavailable"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "500-01",
"message": "Internal server error"
}
}Add a conversation metadata
Add metadata attributes of one issue/conversation
curl --request POST \
--url https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data @- <<EOF
{
"externalConversationId": "id-1389",
"eventId": "eventId-1388",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group59",
"groupName": "groupXYZ",
"agentRoutingCode": "route-13988",
"campaign": "campaign-A",
"deviceType": "TABLET",
"platform": "IOS",
"companySegment": [
"Sales",
"Marketing"
],
"companySubdivision": "operating",
"businessRule": "Apply customer's discount",
"entryType": "reactive",
"operatingSystem": "MAC_OS",
"browserType": "Safari",
"browserVersion": "14.1.2",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
}
EOFimport requests
url = "https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata"
payload = {
"externalConversationId": "id-1389",
"eventId": "eventId-1388",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group59",
"groupName": "groupXYZ",
"agentRoutingCode": "route-13988",
"campaign": "campaign-A",
"deviceType": "TABLET",
"platform": "IOS",
"companySegment": ["Sales", "Marketing"],
"companySubdivision": "operating",
"businessRule": "Apply customer's discount",
"entryType": "reactive",
"operatingSystem": "MAC_OS",
"browserType": "Safari",
"browserVersion": "14.1.2",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
}
headers = {
"asapp-api-id": "<api-key>",
"asapp-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'asapp-api-id': '<api-key>',
'asapp-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalConversationId: 'id-1389',
eventId: 'eventId-1388',
lobId: '1038',
lobName: 'manufacturing',
groupId: 'group59',
groupName: 'groupXYZ',
agentRoutingCode: 'route-13988',
campaign: 'campaign-A',
deviceType: 'TABLET',
platform: 'IOS',
companySegment: ['Sales', 'Marketing'],
companySubdivision: 'operating',
businessRule: 'Apply customer\'s discount',
entryType: 'reactive',
operatingSystem: 'MAC_OS',
browserType: 'Safari',
browserVersion: '14.1.2',
attributes: [
{name: 'attr1_name', value: 'attr1_value'},
{name: 'attr2_name', value: 'attr2_value'}
]
})
};
fetch('https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata', 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.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata",
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([
'externalConversationId' => 'id-1389',
'eventId' => 'eventId-1388',
'lobId' => '1038',
'lobName' => 'manufacturing',
'groupId' => 'group59',
'groupName' => 'groupXYZ',
'agentRoutingCode' => 'route-13988',
'campaign' => 'campaign-A',
'deviceType' => 'TABLET',
'platform' => 'IOS',
'companySegment' => [
'Sales',
'Marketing'
],
'companySubdivision' => 'operating',
'businessRule' => 'Apply customer\'s discount',
'entryType' => 'reactive',
'operatingSystem' => 'MAC_OS',
'browserType' => 'Safari',
'browserVersion' => '14.1.2',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
],
[
'name' => 'attr2_name',
'value' => 'attr2_value'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"asapp-api-id: <api-key>",
"asapp-api-secret: <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 := "https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata"
payload := strings.NewReader("{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("asapp-api-id", "<api-key>")
req.Header.Add("asapp-api-secret", "<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("https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/metadata-ingestion/v1/single-convo-metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["asapp-api-id"] = '<api-key>'
request["asapp-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalConversationId\": \"id-1389\",\n \"eventId\": \"eventId-1388\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group59\",\n \"groupName\": \"groupXYZ\",\n \"agentRoutingCode\": \"route-13988\",\n \"campaign\": \"campaign-A\",\n \"deviceType\": \"TABLET\",\n \"platform\": \"IOS\",\n \"companySegment\": [\n \"Sales\",\n \"Marketing\"\n ],\n \"companySubdivision\": \"operating\",\n \"businessRule\": \"Apply customer's discount\",\n \"entryType\": \"reactive\",\n \"operatingSystem\": \"MAC_OS\",\n \"browserType\": \"Safari\",\n \"browserVersion\": \"14.1.2\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"result": {
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
}
}{
"result": {
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "401-01",
"message": "Unauthorized"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "403-01",
"message": "Forbidden Response"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "404-01",
"message": "Not Found"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "409-01",
"message": "Conflict"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "413-01",
"message": "Request Entity Too Large"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "422-01",
"message": "Unprocessable Entity"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "429-01",
"message": "Too Many Requests"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "503-01",
"message": "Service Unavailable"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "500-01",
"message": "Internal server error"
}
}Body
A set of conversation metadata attributes
Conversation ID from the external chat / voice system
256[a-zA-Z0-9\-\_]+"issue1389"
An event id used to track the submission; if none is provided, service will generate one
256[a-zA-Z0-9\-\_]+"eventId-1388"
The line of business id
256[a-zA-Z0-9\-\_]+"1038"
The descriptive name of the line of business
256"manufacturing"
The group id of which the agent belong to
256[a-zA-Z0-9\-\_]+"group59"
The descriptive name of the group
256"groupXYZ"
The agent's routing attribute
256[a-zA-Z0-9\-\_]+"route-13988"
The activities related to the issue
256[a-zA-Z0-9\-\_]+"campaign-A"
The client's device type
TABLET, PHONE, DESKTOP, WATCH, OTHER "TABLET"
The client's platform type WAB: WhatsApp Business
SMS, WEB, IOS, ANDROID, APP, LOCAL, VOICE, VOICE_IOS, VOICE_ANDROID, VOICE_ECHO, VOICE_HOMEPOD, VOICE_GGLHOME, VOICE_WEB, APPLEBIZ, GOOGLEBIZ, GBM, WAB "IOS"
The company's segment of which the issue belongs to
64[a-zA-Z0-9\-\_]+["Sales", "Marketing"]
The company's subdivision of which the issue belongs to
256[a-zA-Z0-9\-\_]+"Operating"
The business rule to use
256"Apply customer's discount"
The way the issue started and created in the system
256[a-zA-Z0-9\-\_]+"reactive"
The operating system used to enter the issue
MAC_OS, LINUX, WINDOWS, ANDROID, IOS, OTHER "MAC_OS"
The browser type used
64[a-zA-Z0-9\-\_]+"Safari"
The browser version used
16[a-zA-Z0-9\-\_\.]+"14.1.2"
A map of key-value pairs for extra metadata attributes
10Show child attributes
Show child attributes
[
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
Response
200 - Success Submit a single item to the service to be ingested. Record can be traced back to the submitted record by the eventId. A message sent status will be returned with no error message for successful input checks.
A response with the status of a sent message
Show child attributes
Show child attributes
{
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
}
Was this page helpful?