curl --request POST
--url https://api.taskware.io/phonecalls
--header 'accept: application/vnd.api+json; version=1'
--header 'content-type: application/vnd.api+json'
--header 'x-api-key: TASKWARE-TEST-API-TOKEN'
--data '{"data":{"type":"phonecalls","attributes":{"dictionary":{"unique":[{"email":"Client Email"},{"region":"Region","options":{"values":["HI","CA","FL"],"single_choice":false}}],"multiple":[[{"street":"Street address"}],[{"city":"City"},{"zip_code":"Zip Code"}]]},"flow-id":"AP300PHONTA","guidelines":"Call this person and follow the script","callback-url":"http://example.com","media":{"type":"text","source":"Some text"},"entity":{"phone_number":"
","contact_name":"John","script":"Hello my name is <>, and I am calling on behalf of <>, I’m looking to update your account records can you please provide me with your contact information? I need to update your email and physical mailing address"}}}}'
var data = JSON.stringify({
"data": {
"type": "phonecalls",
"attributes": {
"dictionary": {
"unique": [
{
"email": "Client Email"
},
{
"region": "Region",
"options": {
"values": [
"HI",
"CA",
"FL"
],
"single_choice": false
}
}
],
"multiple": [
[
{
"street": "Street address"
}
],
[
{
"city": "City"
},
{
"zip_code": "Zip Code"
}
]
]
},
"flow-id": "AP300PHONTA",
"guidelines": "Call this person and follow the script",
"callback-url": "http://example.com",
"media": {
"type": "text",
"source": "Some text"
},
"entity": {
"phone_number": "
",
"contact_name": "John",
"script": "Hello my name is <>, and I am calling on behalf of <>, I’m looking to update your account records can you please provide me with your contact information? I need to update your email and physical mailing address"
}
}
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.taskware.io/phonecalls");
xhr.setRequestHeader("x-api-key", "TASKWARE-TEST-API-TOKEN");
xhr.setRequestHeader("content-type", "application/vnd.api+json");
xhr.setRequestHeader("accept", "application/vnd.api+json; version=1");
xhr.send(data);
import http.client
conn = http.client.HTTPSConnection("api.taskware.io")
payload = "{"data":{"type":"phonecalls","attributes":{"dictionary":{"unique":[{"email":"Client Email"},{"region":"Region","options":{"values":["HI","CA","FL"],"single_choice":false}}],"multiple":[[{"street":"Street address"}],[{"city":"City"},{"zip_code":"Zip Code"}]]},"flow-id":"AP300PHONTA","guidelines":"Call this person and follow the script","callback-url":"http://example.com","media":{"type":"text","source":"Some text"},"entity":{"phone_number":"
","contact_name":"John","script":"Hello my name is <>, and I am calling on behalf of <>, I’m looking to update your account records can you please provide me with your contact information? I need to update your email and physical mailing address"}}}}"
headers = {
'x-api-key': "TASKWARE-TEST-API-TOKEN",
'content-type': "application/vnd.api+json",
'accept': "application/vnd.api+json; version=1"
}
conn.request("POST", "/phonecalls", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.taskware.io/phonecalls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["x-api-key"] = 'TASKWARE-TEST-API-TOKEN'
request["content-type"] = 'application/vnd.api+json'
request["accept"] = 'application/vnd.api+json; version=1'
request.body = "{"data":{"type":"phonecalls","attributes":{"dictionary":{"unique":[{"email":"Client Email"},{"region":"Region","options":{"values":["HI","CA","FL"],"single_choice":false}}],"multiple":[[{"street":"Street address"}],[{"city":"City"},{"zip_code":"Zip Code"}]]},"flow-id":"AP300PHONTA","guidelines":"Call this person and follow the script","callback-url":"http://example.com","media":{"type":"text","source":"Some text"},"entity":{"phone_number":"
","contact_name":"John","script":"Hello my name is <>, and I am calling on behalf of <>, I’m looking to update your account records can you please provide me with your contact information? I need to update your email and physical mailing address"}}}}"
response = http.request(request)
puts response.read_body