To create a contact:
- Make a request HTTP POST to the URl:
https://integrations.nubitalk.com/standard/api/v1/service/{serviceid}/contacts/{checkrepeated}- Change the {serviceid} for the desired service id (on the Supervisor's editor screen).
- Change the {checkrepeated} by true or false:
- True - Contact is created only if there's no other contact with the same address.
- False - Create the contact even if there's another contact with the same address.
- The request has as mandatory headers, Content-Type (application/json) and Authorization (Bearer 579A893FAF5AB413DB3B42A91B21).
- The request has as Body, an object JSON where the following fields are available:
- Address
- Priority
- NextTry
- AgentID
- Metadata
Note: The NextrTry, when present, has the format YYYY-MM-DDThh:mm:ss (e.g: 2018-04-25T12:00:00).
- Fill the metadata with the JSON objects list format (e.g: "Metadata": [{ "Name" : "Metadata1", "Type" : "231", "Value" : "created" }, {"Name" : "Metadata3", "Type" : "231", "Value" : "Metadata3Field" }]).
- Each object inside the Metada field has three fields:
- Name - Fill with the extra's field name added via OneContact.
- Type - Fill with:
- 231 or string - To identify the field type as a string.
- 56 or int - to identify an integer.
- 61 or datetime to identify a DateTime field.
- 104 or boolean to identify the field type as boolean.
- Value - Fill with the value to fill on the ContactManagement.
- All the fields mentioned before have the mandatory status defined in the Contact List Setup, on OneSupervisor.
- The request response can be one of the following JSON objects:
- {“success”: false} - If there's an error.
- {“success”: true, “data”: 14} - If it's successful. The field data identifies the contactID created by OneContact (this ID allows to interact again with the contact to update or delete via the API).
Examples:
Curl
curl -X POST \
https://integrations.nubitalk.com/standard/api/v1/service/484/contacts/true \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: 9ac5a7de-823c-450b-96a4-ce0d8a6b2dd1' \
-H 'authorization: Bearer xxxx\
-H 'content-type: application/json' \
-d '{"Address":"91112111" , "Priority": "1", "AgentID": "123" ,"NextTry": "2018-04-25T12:00:00", "Metadata": [{ "Name" : "Metadata1", "Type" : "string", "Value" : "created" }]}'
C#
var client = new RestClient("https://integrations.nubitalk.com/standard/api/v1/service/484/contacts/true");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "bafd2385-79bf-4fe0-bb91-8446cd87a0c2");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer xxxx");
request.AddHeader("Cache-Control", "no-cache");
request.AddParameter("application/json", "{\"Address\":\"91112111\" , \"Priority\": \"1\", \"AgentID\": \"123\" ,\"NextTry\": \"2018-04-25T12:00:00\", \"Metadata\": [{ \"Name\" : \"Metadata1\", \"Type\" : \"string\", \"Value\" : \"created\" }]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
To update a contact:
- Make a request HTTP PUT to the URl:
https://integrations.nubitalk.com/standard/api/v1/service/{serviceid}/contacts/{contactid} - Change the {serviceid} for the desired service id (on the Supervisor's editor screen).
- Change the {contactid} for the contact id (from the Manage Contacts screen on OneSupervisor or the returned value if it was created via the API)
- The request has as mandatory headers, Content-Type (application/json) and Authorization (Bearer 579132EE3186AD57B428353D38BDA).
- The request has as Body, an object JSON where the following fields are available:
- Address
- Priority
- NextTry
- AgentID
- Metadata
Note: The NextrTry, when present, has the format YYYY-MM-DDThh:mm:ss (e.g: 2018-04-25T12:00:00).
- Fill the metadata with the JSON objects list format (e.g: "Metadata": [{ "Name" : "Metadata1", "Type" : "231", "Value" : "created" }, {"Name" : "Metadata3", "Type" : "231", "Value" : "Metadata3Field" }]).
- Each object inside the Metada field has three fields:
- Name - Fill with the extra's field name added via OneContact.
- Type - Fill with:
- 231 or string - To identify the field type as a string.
- 56 or int - to identify an integer.
- 61 or datetime to identify a DateTime field.
- 104 or boolean to identify the field type as boolean.
- Value - Fill with the value to fill on the ContactManagement.
- All the fields mentioned before have the mandatory status defined in the Contact List Setup, on OneSupervisor.
- The request response can be one of the following JSON objects:
- {“success”: false} - If there's an error.
- {“success”: true, “data”: 14} - If it's successful. The field data identifies the contactID created by OneContact (this ID allows to interact again with the contact to update or delete via the API).
Examples:
Curl
curl -X PUT \
https://integrations.nubitalk.com/standard/api/v1/service/484/contacts/8 \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: 98297921-fa77-437a-9886-90917a9e3568' \
-H 'authorization: Bearer xxxx \
-H 'content-type: application/json' \
-d '{"Address":"91112111" ,"NextTry": "2018-04-25T12:00:00", "Metadata": [{ "Name" : "URL", "Type" : "231", "Value" : "updated" }]}'
C#
var client = new RestClient("https://integrations.nubitalk.com/standard/api/v1/service/484/contacts/8");
var request = new RestRequest(Method.PUT);
request.AddHeader("Postman-Token", "793090ac-1b96-4eee-8cc7-de6c5ca64495");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer xxxx");
request.AddHeader("Cache-Control", "no-cache");
request.AddParameter("application/json", "{\"Address\":\"91112111\" ,\"NextTry\": \"2018-04-25T12:00:00\", \"Metadata\": [{ \"Name\" : \"URL\", \"Type\" : \"231\", \"Value\" : \"updated\" }]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
To delete a contact:
- Make a request HTTP DELETE to the URl:
https://integrations.nubitalk.com/standard/api/v1/service/{serviceid}/contacts/{contactid} - Change the {serviceid} for the desired service id (on the Supervisor's editor screen).
- Change the {contactid} for the contact id (from the Manage Contacts screen on OneSupervisor or the returned value if it was created via the API)
- The request has as mandatory headers, Content-Type (application/json) and Authorization (Bearer 579132EE3186AD57B428353D38BDA).
- The request doesn't require a body.
Examples:
Curl
curl -X DELETE \
'https://integrations.nubitalk.com/standard/api/v1/service/{serviceid}/contacts/{contactid}' \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: 310e9785-499d-431a-99cb-fc8c45d50b08' \
-H 'authorization: Bearer xxxx \
-H 'content-type: application/json'
C#
var client = new RestClient("https://integrations.nubitalk.com/standard/api/v1/service/{serviceid}/contacts/{contactid}");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Postman-Token", "befd0e3a-767a-43bb-928d-bcb7ba402540");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer xxxx");
request.AddHeader("Cache-Control", "no-cache");
IRestResponse response = client.Execute(request);