Update a specific contact that exists in the CRM within a specific project. You can match a contact by either email or contact_id.
Request
Method: update_contact
Request Body
{
"api_key":"xxxxxxxxxxxxx", //required
"action": "update_contact", //required
"value": {
"project_id": 0, //required
"contact_id": 0, //required *
"email": "john.smith@gmail.com", //required *
"first_name": "John",
"last_name": "Smith",
"organization": "Google LLC",
"address": "225 Avon Ave",
"address2": "string",
"city": "Indianapolis",
"state": "Indiana",
"zip": "46077",
"country": "United States",
"phone": "+1 317 787 2271",
"fax": "+1 317 787 2271",
"sms_number": "+1 317 787 2271",
"birthday": 1674663560,
"website": "https://google.com",
"date": 1674663560,
"ip": "95.145.35.241",
"timezone": "America/Indiana/Indianapolis",
"facebook_profile": "https://www.facebook.com/johnsmith",
"twitter": "https://twitter.com/johnsmith",
"linked_in": "https://www.linkedin.com/in/johnsmith/",
"instagram": "https://www.instagram.com/johnsmith/",
"pinterest": "https://www.pinterest.com/johnsmith/",
"skype": "johnusername",
"role": "Web Developer",
"cf_{field_name}_{field_id}": "string",
"segment": "13,435,275",
"tag": "13,435,275"
}
}
curl --location --request POST 'https://api.platform.ly' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=xxxxxxxxxxxxx' \
--data-urlencode 'action=update_contact' \
--data-urlencode 'value={"project_id":0, "email":"john.smith@gmail.com", "first_name":"John", "last_name":"Smith"}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.platform.ly',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'api_key=xxxxxxxxxxxxx&action=update_contact&value=%7B%22project_id%22%3A0%2C%20%22email%22%3A%22john.smith%40gmail.com%22%2C%20%22first_name%22%3A%22John%22%2C%20%22last_name%22%3A%22Smith%22%7D',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.platform.ly"
payload='api_key=xxxxxxxxxxxxx&action=update_contact&value=%7B%22project_id%22%3A0%2C%20%22email%22%3A%22john.smith%40gmail.com%22%2C%20%22first_name%22%3A%22John%22%2C%20%22last_name%22%3A%22Smith%22%7D'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=xxxxxxxxxxxxx&action=update_contact&value={\"project_id\":0, \"email\":\"john.smith@gmail.com\", \"first_name\":\"John\", \"last_name\":\"Smith\"}");
Request request = new Request.Builder()
.url("https://api.platform.ly")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Request Format
api_key required
Authentication API Key.
Where can I find my API Key?
action required
update_contact
value required
JSON formatted string with additional request values
project_id required
Your Project ID.
Where can I find my Project ID?contact_id required *
Contact ID.
email required *
Valid Contact Email Address
first_name optional
Contact First Name
last_name optional
Contact Last Name
organization optional
Contact Company/Organization Name
address optional
Contact Address
address2 optional
Contact Address 2
city optional
Contact City
state optional
Contact State
zip optional
Contact Zip Code
country optional
Contact Country
phone optional
Contact Phone Number
fax optional
Contact Fax
sms_number optional
Contact SMS Number
birthday optional
Contact Birthday Date (Timestamp)
website optional
Contact Website URL
date optional
Contact Creation Date (Timestamp)
ip optional
Contact IP Address
timezone optional
Contact Timezone
Check Allowed Timezonesfacebook_profile optional
Contact Facebook Profile URL
twitter optional
Contact Twitter Profile URL
linked_in optional
Contact LinkedIn Profile URL
instagram optional
Contact Instagram Profile URL
pinterest optional
Contact Pinterest URL
skype optional
Contact Skype Username
role optional
Contact Job Role
cf{field_name}{field_id} optional
Contact Custom Field
Read Moresegment optional
Segment IDs separated by comma
Where can I find my Segment ID?tag optional
Tag IDs separated by comma
Where can I find my Tag ID?
* At least one of the following fields is required: contact_id, email
Response
Returns a JSON object with the updated contact id if the request succeeded. Returns an error if the request parameters are invalid.
200 OK
{
"status": "success",
"message": "The action has been processed",
"data": {
"cc_id": 0
}
}