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": "[email protected]", //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":"[email protected]", "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\":\"[email protected]\", \"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 Addressfirst_name optional
Contact First Namelast_name optional
Contact Last Nameorganization optional
Contact Company/Organization Nameaddress optional
Contact Addressaddress2 optional
Contact Address 2city optional
Contact Citystate optional
Contact Statezip optional
Contact Zip Codecountry optional
Contact Countryphone optional
Contact Phone Numberfax optional
Contact Faxsms_number optional
Contact SMS Numberbirthday optional
Contact Birthday Date (Timestamp)website optional
Contact Website URLdate optional
Contact Creation Date (Timestamp)ip optional
Contact IP Addresstimezone optional
Contact TimezoneCheck Allowed Timezonesfacebook_profile optional
Contact Facebook Profile URLtwitter optional
Contact Twitter Profile URLlinked_in optional
Contact LinkedIn Profile URLinstagram optional
Contact Instagram Profile URLpinterest optional
Contact Pinterest URLskype optional
Contact Skype Usernamerole optional
Contact Job Rolecf{field_name}{field_id} optional
Contact Custom FieldRead Moresegment optional
Segment IDs separated by commaWhere can I find my Segment ID?tag optional
Tag IDs separated by commaWhere 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
}
}
