PUT https://examplebaseURL.com/v1/api/apps/{appID}/management/update_externalcontact/{contac
| Parameter | Type | Description |
|---|---|---|
| code | Number | Refer to Success and Error Code |
| id | String | External contact id |
📘
Location and Language Format
- Please refer to our Open API - Get Supported Location List section for the supported country code format.
- Please refer to our Open API - Get Supported Language List section for the supported language format.
appID string required
App ID
contactID string required
The ID of the external contact you are required to update.
firstName string
First name of the external contactlastName string
Last name of the external contactlevel string Defaults to Primary
Level of the external contact. It supports Primary (Default), Secondary, or Tertiary.type string Defaults to Lead
Type of the external contact. It supports Lead (Default), Prospect, Customer, or "Others".phones object
phones object
type string
Type of the phone number of the external contact. It supports Mobile, Work, Home, or "Other".
phone string
Phone number of the external contact. Format: Country code+Phone number. For example: +85294667788. Note that "+" should be added in front of the country code.emails object
emails object
type string
Type the email address of the external contact. It supports Work, Personal, or "Other".
email string
Email address of the external contact.company string
Company name of the external contact.jobTitle string
Job title of the external contact.team string
Name of the team the external contact belongs to.group string
Name of the group the external contact belongs to.language string
Language is the external contact can use to communicate with people. It is based on the ISO 639-1 Language Codes. Example: en (Language code of English in ISO 639-1)birthDate string
Date of birth of the external contact. Format: DD/MM/YYYY.addresses object
addresses object
street string
Street
city string
City
state string
Statezipcode string
Zip code
country string
Country. It is represented by the two-letter country code based on ISO 3166-2.socialContacts object
socialContacts object
key string
The social media type the external contact uses. The social media type supports Facebook, WhatsApp, WeChat, LINE, Twitter, LinkedIn, WoztellWhatsApp, WoztellFacebook, or WoztellInstagram.
value string
User name/ID of the social media used by the external contact. Format: type + id/name. The limit of the user name/ID is 100 characters.customField object
customField object
FieldTypePicklist string
Single-select picklist. Allows the user to select one option from a list of predefined values. Automatically removes invalid options. If multiple values are present, an error is returned.
FieldTypeMultiPicklist string
Multi-select picklist. Allows the user to select multiple options from a list of predefined values. Automatically removes invalid options. Multiple values are allowed.
FieldTypeText string
Text input field. Allows the user to input any text. Maximum length is 500 characters.
FieldTypeURL string
URL input field. Allows the user to input a valid URL. Maximum length is 500 characters.
FieldTypeBoolean string
Boolean field. Allows the user to input a true or false value (case-insensitive). Only accepts true or false (case-insensitive).
FieldTypeDate string
Date field. Allows the user to input a valid date in RFC3339 format. Must be in RFC3339 format (e.g., YYYY-MM-DDTHH:MM:SSZ).
FieldTypeTime string
Time field. Allows the user to input a valid time in the format HH:MM. Must be in HH:MM format (24-hour clock).
Content-Type string
application/jsonAuthorization string
Bearer AppToken
200
Response body
json400
Response body
object
code integer Defaults to 0
message string
LANGUAGE: Shell
curl --request PUT \
--url https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID \
--header 'Authorization: Bearer AppToken' \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--data '
{
"level": "Primary",
"type": "Lead"
}
'
$ brew install httpie
echo '{"level":"Primary","type":"Lead"}' | \
http PUT https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID \
Authorization:'Bearer AppToken' \
Content-Type:application/json \
accept:application/json
LANGUAGE: Node
$ npm install axios --save
import axios from 'axios';
const options = {
method: 'PUT',
url: 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
},
data: {level: 'Primary', type: 'Lead'}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
const url = 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID';
const options = {
method: 'PUT',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
},
body: JSON.stringify({level: 'Primary', type: 'Lead'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
const http = require('https');
const options = {
method: 'PUT',
hostname: 'examplebaseurl.com',
port: null,
path: '/v1/api/apps/appID/management/update_externalcontact/contactID',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({level: 'Primary', type: 'Lead'}));
req.end();
$ npx api install "@cinnox2021/v7.3#45i1wk2km9l1e4hf"
import cinnox2021 from '@api/cinnox2021';
cinnox2021.updateExternal({level: 'Primary', type: 'Lead'}, {
appID: 'appID',
contactID: 'contactID',
Authorization: 'Bearer AppToken'
})
.then(({ data }) => console.log(data))
.catch(err => console.error(err));
LANGUAGE: Ruby
require 'uri'
require 'net/http'
url = URI("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Bearer AppToken'
request.body = "{\"level\":\"Primary\",\"type\":\"Lead\"}"
response = http.request(request)
puts response.read_body
LANGUAGE: PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'level' => 'Primary',
'type' => 'Lead'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer AppToken",
"Content-Type: application/json",
"accept: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
$ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID', [
'body' => '{"level":"Primary","type":"Lead"}',
'headers' => [
'Authorization' => 'Bearer AppToken',
'Content-Type' => 'application/json',
'accept' => 'application/json',
],
]);
echo $response->getBody();
LANGUAGE: Python
$ python -m pip install requests
import requests
url = "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"
payload = {
"level": "Primary",
"type": "Lead"
}
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer AppToken"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)
LANGUAGE: C
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer AppToken");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"level\":\"Primary\",\"type\":\"Lead\"}");
CURLcode ret = curl_easy_perform(hnd);
LANGUAGE: C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"),
Headers =
{
{ "accept", "application/json" },
{ "Authorization", "Bearer AppToken" },
},
Content = new StringContent("{\"level\":\"Primary\",\"type\":\"Lead\"}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
$ dotnet add package RestSharp
using RestSharp;
var options = new RestClientOptions("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddHeader("Authorization", "Bearer AppToken");
request.AddJsonBody("{\"level\":\"Primary\",\"type\":\"Lead\"}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
LANGUAGE: C++
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer AppToken");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"level\":\"Primary\",\"type\":\"Lead\"}");
CURLcode ret = curl_easy_perform(hnd);
LANGUAGE: Clojure
(require '[clj-http.client :as client])
(client/put "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID" {:headers {:Authorization "Bearer AppToken"}
:content-type :json
:form-params {:level "Primary"
:type "Lead"}
:accept :json})
LANGUAGE: Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"
payload := strings.NewReader("{\"level\":\"Primary\",\"type\":\"Lead\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer AppToken")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
LANGUAGE: HTTP
PUT /v1/api/apps/appID/management/update_externalcontact/contactID HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer AppToken
Host: examplebaseurl.com
Content-Length: 33
{"level":"Primary","type":"Lead"}
LANGUAGE: Java
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")
.setHeader("accept", "application/json")
.setHeader("Content-Type", "application/json")
.setHeader("Authorization", "Bearer AppToken")
.setBody("{\"level\":\"Primary\",\"type\":\"Lead\"}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"))
.header("accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer AppToken")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\"level\":\"Primary\",\"type\":\"Lead\"}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"level\":\"Primary\",\"type\":\"Lead\"}");
Request request = new Request.Builder()
.url("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")
.put(body)
.addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer AppToken")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.put("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")
.header("accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer AppToken")
.body("{\"level\":\"Primary\",\"type\":\"Lead\"}")
.asString();
LANGUAGE: JavaScript
$ npm install axios --save
import axios from 'axios';
const options = {
method: 'PUT',
url: 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
},
data: {level: 'Primary', type: 'Lead'}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
const options = {
method: 'PUT',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
},
body: JSON.stringify({level: 'Primary', type: 'Lead'})
};
fetch('https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const settings = {
async: true,
crossDomain: true,
url: 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID',
method: 'PUT',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
},
processData: false,
data: '{"level":"Primary","type":"Lead"}'
};
$.ajax(settings).done(res => {
console.log(res);
});
const data = JSON.stringify({
level: 'Primary',
type: 'Lead'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID');
xhr.setRequestHeader('accept', 'application/json');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Authorization', 'Bearer AppToken');
xhr.send(data);
LANGUAGE: JSON
{
"level": "Primary",
"type": "Lead"
}
LANGUAGE: Kotlin
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\"level\":\"Primary\",\"type\":\"Lead\"}")
val request = Request.Builder()
.url("https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")
.put(body)
.addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer AppToken")
.build()
val response = client.newCall(request).execute()
LANGUAGE: Objectve-C
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"accept": @"application/json",
@"Content-Type": @"application/json",
@"Authorization": @"Bearer AppToken" };
NSDictionary *parameters = @{ @"level": @"Primary",
@"type": @"Lead" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
LANGUAGE: OCaml
$ opam install cohttp-lwt-unix cohttp-async
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID" in
let headers = Header.add_list (Header.init ()) [
("accept", "application/json");
("Content-Type", "application/json");
("Authorization", "Bearer AppToken");
] in
let body = Cohttp_lwt_body.of_string "{\"level\":\"Primary\",\"type\":\"Lead\"}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
LANGUAGE: PowerShell
$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer AppToken")
$response = Invoke-RestMethod -Uri 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{"level":"Primary","type":"Lead"}'
$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer AppToken")
$response = Invoke-WebRequest -Uri 'https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{"level":"Primary","type":"Lead"}'
LANGUAGE: R
library(httr)
url <- "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID"
payload <- "{\"level\":\"Primary\",\"type\":\"Lead\"}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('Authorization' = 'Bearer AppToken'), content_type("application/json"), accept("application/json"), encode = encode)
content(response, "text")
LANGUAGE: Swift
import Foundation
let parameters = [
"level": "Primary",
"type": "Lead"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://examplebaseurl.com/v1/api/apps/appID/management/update_externalcontact/contactID")!
var request = URLRequest(url: url)
request.httpMethod = "PUT"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer AppToken"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
RESPONSE: 200-Result
{
"code": Number,
"result": {
"id": "string"
},
"cid": "string"
}
RESPONSE: 400-Result
{
"code": 0,
"message": "The error message from the server. Please refer to the error table."
}