Add multiple agent metadata
curl --request POST \
--url https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-metadata \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data '
{
"items": [
{
"externalAgentId": "agent158",
"startTs": "2022-07-08T11:15:53.237517000Z",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group5",
"groupName": "XYZ",
"agentName": "Jane Doe",
"agentLocation": "Northern-California",
"supervisorId": "3080",
"supervisorName": "Linda Lemon",
"languages": [
"en-us",
"zh-hans-hk",
"es-pe"
],
"concurrency": 3,
"categoryLabel": "Tier-2-Escalation",
"accountAccessLevel": "High-Profile",
"ranking": 78,
"vendor": "Contracting",
"jobTitle": "Booking-Manager",
"jobRole": "booking",
"workShift": "afternoon",
"emailAddress": "jdoe@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
},
{
"externalAgentId": "agent392",
"startTs": "2021-09-02T11:15:53.237517000Z",
"lobId": "968",
"lobName": "insurance",
"groupId": "group3",
"groupName": "DFG",
"agentName": "Jonathan Master",
"agentLocation": "Southern-California",
"supervisorId": "1290",
"supervisorName": "John Luna",
"languages": [
"en-us"
],
"concurrency": 3,
"categoryLabel": "Tier-1-Service",
"accountAccessLevel": "High-Profile",
"ranking": 75,
"vendor": "Contracting",
"jobTitle": "Customer-Service",
"jobRole": "Support",
"workShift": "afternoon",
"emailAddress": "jmaster@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
}
]
},
{
"externalAgentId": "agent6922",
"startTs": null
},
{
"externalAgentId": "agent222"
},
{
"externalAgentId": "agent333",
"emailAddress": "jdoe@example.com"
}
]
}
'import requests
url = "https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-metadata"
payload = { "items": [
{
"externalAgentId": "agent158",
"startTs": "2022-07-08T11:15:53.237517000Z",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group5",
"groupName": "XYZ",
"agentName": "Jane Doe",
"agentLocation": "Northern-California",
"supervisorId": "3080",
"supervisorName": "Linda Lemon",
"languages": ["en-us", "zh-hans-hk", "es-pe"],
"concurrency": 3,
"categoryLabel": "Tier-2-Escalation",
"accountAccessLevel": "High-Profile",
"ranking": 78,
"vendor": "Contracting",
"jobTitle": "Booking-Manager",
"jobRole": "booking",
"workShift": "afternoon",
"emailAddress": "jdoe@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
},
{
"externalAgentId": "agent392",
"startTs": "2021-09-02T11:15:53.237517000Z",
"lobId": "968",
"lobName": "insurance",
"groupId": "group3",
"groupName": "DFG",
"agentName": "Jonathan Master",
"agentLocation": "Southern-California",
"supervisorId": "1290",
"supervisorName": "John Luna",
"languages": ["en-us"],
"concurrency": 3,
"categoryLabel": "Tier-1-Service",
"accountAccessLevel": "High-Profile",
"ranking": 75,
"vendor": "Contracting",
"jobTitle": "Customer-Service",
"jobRole": "Support",
"workShift": "afternoon",
"emailAddress": "jmaster@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
}
]
},
{
"externalAgentId": "agent6922",
"startTs": None
},
{ "externalAgentId": "agent222" },
{
"externalAgentId": "agent333",
"emailAddress": "jdoe@example.com"
}
] }
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({
items: [
{
externalAgentId: 'agent158',
startTs: '2022-07-08T11:15:53.237517000Z',
lobId: '1038',
lobName: 'manufacturing',
groupId: 'group5',
groupName: 'XYZ',
agentName: 'Jane Doe',
agentLocation: 'Northern-California',
supervisorId: '3080',
supervisorName: 'Linda Lemon',
languages: ['en-us', 'zh-hans-hk', 'es-pe'],
concurrency: 3,
categoryLabel: 'Tier-2-Escalation',
accountAccessLevel: 'High-Profile',
ranking: 78,
vendor: 'Contracting',
jobTitle: 'Booking-Manager',
jobRole: 'booking',
workShift: 'afternoon',
emailAddress: 'jdoe@example.com',
attributes: [
{name: 'attr1_name', value: 'attr1_value'},
{name: 'attr2_name', value: 'attr2_value'}
]
},
{
externalAgentId: 'agent392',
startTs: '2021-09-02T11:15:53.237517000Z',
lobId: '968',
lobName: 'insurance',
groupId: 'group3',
groupName: 'DFG',
agentName: 'Jonathan Master',
agentLocation: 'Southern-California',
supervisorId: '1290',
supervisorName: 'John Luna',
languages: ['en-us'],
concurrency: 3,
categoryLabel: 'Tier-1-Service',
accountAccessLevel: 'High-Profile',
ranking: 75,
vendor: 'Contracting',
jobTitle: 'Customer-Service',
jobRole: 'Support',
workShift: 'afternoon',
emailAddress: 'jmaster@example.com',
attributes: [{name: 'attr1_name', value: 'attr1_value'}]
},
{externalAgentId: 'agent6922', startTs: null},
{externalAgentId: 'agent222'},
{externalAgentId: 'agent333', emailAddress: 'jdoe@example.com'}
]
})
};
fetch('https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-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/many-agent-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([
'items' => [
[
'externalAgentId' => 'agent158',
'startTs' => '2022-07-08T11:15:53.237517000Z',
'lobId' => '1038',
'lobName' => 'manufacturing',
'groupId' => 'group5',
'groupName' => 'XYZ',
'agentName' => 'Jane Doe',
'agentLocation' => 'Northern-California',
'supervisorId' => '3080',
'supervisorName' => 'Linda Lemon',
'languages' => [
'en-us',
'zh-hans-hk',
'es-pe'
],
'concurrency' => 3,
'categoryLabel' => 'Tier-2-Escalation',
'accountAccessLevel' => 'High-Profile',
'ranking' => 78,
'vendor' => 'Contracting',
'jobTitle' => 'Booking-Manager',
'jobRole' => 'booking',
'workShift' => 'afternoon',
'emailAddress' => 'jdoe@example.com',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
],
[
'name' => 'attr2_name',
'value' => 'attr2_value'
]
]
],
[
'externalAgentId' => 'agent392',
'startTs' => '2021-09-02T11:15:53.237517000Z',
'lobId' => '968',
'lobName' => 'insurance',
'groupId' => 'group3',
'groupName' => 'DFG',
'agentName' => 'Jonathan Master',
'agentLocation' => 'Southern-California',
'supervisorId' => '1290',
'supervisorName' => 'John Luna',
'languages' => [
'en-us'
],
'concurrency' => 3,
'categoryLabel' => 'Tier-1-Service',
'accountAccessLevel' => 'High-Profile',
'ranking' => 75,
'vendor' => 'Contracting',
'jobTitle' => 'Customer-Service',
'jobRole' => 'Support',
'workShift' => 'afternoon',
'emailAddress' => 'jmaster@example.com',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
]
]
],
[
'externalAgentId' => 'agent6922',
'startTs' => null
],
[
'externalAgentId' => 'agent222'
],
[
'externalAgentId' => 'agent333',
'emailAddress' => 'jdoe@example.com'
]
]
]),
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/many-agent-metadata"
payload := strings.NewReader("{\n \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\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/many-agent-metadata")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-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 \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"errorCount": 1,
"results": [
{
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
},
{
"eventId": "fcf99667-feaf-11ec-a42e-11799134528c",
"error": ""
}
]
}{
"errorCount": 1,
"results": [
{
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
},
{
"eventId": "fcf99667-feaf-11ec-a42e-11799134528c",
"error": ""
}
]
}{
"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"
}
}Agent Metadata
Add multiple agent metadata
Add multiple agent metadata items; submit items in a batch in one request
POST
/
metadata-ingestion
/
v1
/
many-agent-metadata
Add multiple agent metadata
curl --request POST \
--url https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-metadata \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data '
{
"items": [
{
"externalAgentId": "agent158",
"startTs": "2022-07-08T11:15:53.237517000Z",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group5",
"groupName": "XYZ",
"agentName": "Jane Doe",
"agentLocation": "Northern-California",
"supervisorId": "3080",
"supervisorName": "Linda Lemon",
"languages": [
"en-us",
"zh-hans-hk",
"es-pe"
],
"concurrency": 3,
"categoryLabel": "Tier-2-Escalation",
"accountAccessLevel": "High-Profile",
"ranking": 78,
"vendor": "Contracting",
"jobTitle": "Booking-Manager",
"jobRole": "booking",
"workShift": "afternoon",
"emailAddress": "jdoe@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
},
{
"externalAgentId": "agent392",
"startTs": "2021-09-02T11:15:53.237517000Z",
"lobId": "968",
"lobName": "insurance",
"groupId": "group3",
"groupName": "DFG",
"agentName": "Jonathan Master",
"agentLocation": "Southern-California",
"supervisorId": "1290",
"supervisorName": "John Luna",
"languages": [
"en-us"
],
"concurrency": 3,
"categoryLabel": "Tier-1-Service",
"accountAccessLevel": "High-Profile",
"ranking": 75,
"vendor": "Contracting",
"jobTitle": "Customer-Service",
"jobRole": "Support",
"workShift": "afternoon",
"emailAddress": "jmaster@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
}
]
},
{
"externalAgentId": "agent6922",
"startTs": null
},
{
"externalAgentId": "agent222"
},
{
"externalAgentId": "agent333",
"emailAddress": "jdoe@example.com"
}
]
}
'import requests
url = "https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-metadata"
payload = { "items": [
{
"externalAgentId": "agent158",
"startTs": "2022-07-08T11:15:53.237517000Z",
"lobId": "1038",
"lobName": "manufacturing",
"groupId": "group5",
"groupName": "XYZ",
"agentName": "Jane Doe",
"agentLocation": "Northern-California",
"supervisorId": "3080",
"supervisorName": "Linda Lemon",
"languages": ["en-us", "zh-hans-hk", "es-pe"],
"concurrency": 3,
"categoryLabel": "Tier-2-Escalation",
"accountAccessLevel": "High-Profile",
"ranking": 78,
"vendor": "Contracting",
"jobTitle": "Booking-Manager",
"jobRole": "booking",
"workShift": "afternoon",
"emailAddress": "jdoe@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
},
{
"name": "attr2_name",
"value": "attr2_value"
}
]
},
{
"externalAgentId": "agent392",
"startTs": "2021-09-02T11:15:53.237517000Z",
"lobId": "968",
"lobName": "insurance",
"groupId": "group3",
"groupName": "DFG",
"agentName": "Jonathan Master",
"agentLocation": "Southern-California",
"supervisorId": "1290",
"supervisorName": "John Luna",
"languages": ["en-us"],
"concurrency": 3,
"categoryLabel": "Tier-1-Service",
"accountAccessLevel": "High-Profile",
"ranking": 75,
"vendor": "Contracting",
"jobTitle": "Customer-Service",
"jobRole": "Support",
"workShift": "afternoon",
"emailAddress": "jmaster@example.com",
"attributes": [
{
"name": "attr1_name",
"value": "attr1_value"
}
]
},
{
"externalAgentId": "agent6922",
"startTs": None
},
{ "externalAgentId": "agent222" },
{
"externalAgentId": "agent333",
"emailAddress": "jdoe@example.com"
}
] }
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({
items: [
{
externalAgentId: 'agent158',
startTs: '2022-07-08T11:15:53.237517000Z',
lobId: '1038',
lobName: 'manufacturing',
groupId: 'group5',
groupName: 'XYZ',
agentName: 'Jane Doe',
agentLocation: 'Northern-California',
supervisorId: '3080',
supervisorName: 'Linda Lemon',
languages: ['en-us', 'zh-hans-hk', 'es-pe'],
concurrency: 3,
categoryLabel: 'Tier-2-Escalation',
accountAccessLevel: 'High-Profile',
ranking: 78,
vendor: 'Contracting',
jobTitle: 'Booking-Manager',
jobRole: 'booking',
workShift: 'afternoon',
emailAddress: 'jdoe@example.com',
attributes: [
{name: 'attr1_name', value: 'attr1_value'},
{name: 'attr2_name', value: 'attr2_value'}
]
},
{
externalAgentId: 'agent392',
startTs: '2021-09-02T11:15:53.237517000Z',
lobId: '968',
lobName: 'insurance',
groupId: 'group3',
groupName: 'DFG',
agentName: 'Jonathan Master',
agentLocation: 'Southern-California',
supervisorId: '1290',
supervisorName: 'John Luna',
languages: ['en-us'],
concurrency: 3,
categoryLabel: 'Tier-1-Service',
accountAccessLevel: 'High-Profile',
ranking: 75,
vendor: 'Contracting',
jobTitle: 'Customer-Service',
jobRole: 'Support',
workShift: 'afternoon',
emailAddress: 'jmaster@example.com',
attributes: [{name: 'attr1_name', value: 'attr1_value'}]
},
{externalAgentId: 'agent6922', startTs: null},
{externalAgentId: 'agent222'},
{externalAgentId: 'agent333', emailAddress: 'jdoe@example.com'}
]
})
};
fetch('https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-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/many-agent-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([
'items' => [
[
'externalAgentId' => 'agent158',
'startTs' => '2022-07-08T11:15:53.237517000Z',
'lobId' => '1038',
'lobName' => 'manufacturing',
'groupId' => 'group5',
'groupName' => 'XYZ',
'agentName' => 'Jane Doe',
'agentLocation' => 'Northern-California',
'supervisorId' => '3080',
'supervisorName' => 'Linda Lemon',
'languages' => [
'en-us',
'zh-hans-hk',
'es-pe'
],
'concurrency' => 3,
'categoryLabel' => 'Tier-2-Escalation',
'accountAccessLevel' => 'High-Profile',
'ranking' => 78,
'vendor' => 'Contracting',
'jobTitle' => 'Booking-Manager',
'jobRole' => 'booking',
'workShift' => 'afternoon',
'emailAddress' => 'jdoe@example.com',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
],
[
'name' => 'attr2_name',
'value' => 'attr2_value'
]
]
],
[
'externalAgentId' => 'agent392',
'startTs' => '2021-09-02T11:15:53.237517000Z',
'lobId' => '968',
'lobName' => 'insurance',
'groupId' => 'group3',
'groupName' => 'DFG',
'agentName' => 'Jonathan Master',
'agentLocation' => 'Southern-California',
'supervisorId' => '1290',
'supervisorName' => 'John Luna',
'languages' => [
'en-us'
],
'concurrency' => 3,
'categoryLabel' => 'Tier-1-Service',
'accountAccessLevel' => 'High-Profile',
'ranking' => 75,
'vendor' => 'Contracting',
'jobTitle' => 'Customer-Service',
'jobRole' => 'Support',
'workShift' => 'afternoon',
'emailAddress' => 'jmaster@example.com',
'attributes' => [
[
'name' => 'attr1_name',
'value' => 'attr1_value'
]
]
],
[
'externalAgentId' => 'agent6922',
'startTs' => null
],
[
'externalAgentId' => 'agent222'
],
[
'externalAgentId' => 'agent333',
'emailAddress' => 'jdoe@example.com'
]
]
]),
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/many-agent-metadata"
payload := strings.NewReader("{\n \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\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/many-agent-metadata")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/metadata-ingestion/v1/many-agent-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 \"items\": [\n {\n \"externalAgentId\": \"agent158\",\n \"startTs\": \"2022-07-08T11:15:53.237517000Z\",\n \"lobId\": \"1038\",\n \"lobName\": \"manufacturing\",\n \"groupId\": \"group5\",\n \"groupName\": \"XYZ\",\n \"agentName\": \"Jane Doe\",\n \"agentLocation\": \"Northern-California\",\n \"supervisorId\": \"3080\",\n \"supervisorName\": \"Linda Lemon\",\n \"languages\": [\n \"en-us\",\n \"zh-hans-hk\",\n \"es-pe\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-2-Escalation\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 78,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Booking-Manager\",\n \"jobRole\": \"booking\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jdoe@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n },\n {\n \"name\": \"attr2_name\",\n \"value\": \"attr2_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent392\",\n \"startTs\": \"2021-09-02T11:15:53.237517000Z\",\n \"lobId\": \"968\",\n \"lobName\": \"insurance\",\n \"groupId\": \"group3\",\n \"groupName\": \"DFG\",\n \"agentName\": \"Jonathan Master\",\n \"agentLocation\": \"Southern-California\",\n \"supervisorId\": \"1290\",\n \"supervisorName\": \"John Luna\",\n \"languages\": [\n \"en-us\"\n ],\n \"concurrency\": 3,\n \"categoryLabel\": \"Tier-1-Service\",\n \"accountAccessLevel\": \"High-Profile\",\n \"ranking\": 75,\n \"vendor\": \"Contracting\",\n \"jobTitle\": \"Customer-Service\",\n \"jobRole\": \"Support\",\n \"workShift\": \"afternoon\",\n \"emailAddress\": \"jmaster@example.com\",\n \"attributes\": [\n {\n \"name\": \"attr1_name\",\n \"value\": \"attr1_value\"\n }\n ]\n },\n {\n \"externalAgentId\": \"agent6922\",\n \"startTs\": null\n },\n {\n \"externalAgentId\": \"agent222\"\n },\n {\n \"externalAgentId\": \"agent333\",\n \"emailAddress\": \"jdoe@example.com\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"errorCount": 1,
"results": [
{
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
},
{
"eventId": "fcf99667-feaf-11ec-a42e-11799134528c",
"error": ""
}
]
}{
"errorCount": 1,
"results": [
{
"eventId": "5484e507-feaf-11ec-bfc1-fda566fa9333",
"error": "FAIL_BAD_PARAMS: ERROR: agent id cannot be blank"
},
{
"eventId": "fcf99667-feaf-11ec-a42e-11799134528c",
"error": ""
}
]
}{
"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
application/json
A request to send more than one agent metadata; send a list of items
Required array length:
1 - 1000 elementsShow child attributes
Show child attributes
Response
200 - Success | Partial Success Submit a batch of items to the service to be ingested. Record can be traced back to the submitted record by the eventId. If any of the records encounter issue during the ingestion, a message sent status will be returned with an error message for each record. A 200 success is returned as long as there is one item ingested successfully, i.e., "partial success".
Was this page helpful?
⌘I