Fetch a Contact

Returns a specific Contact searched based on Contact ID or Email.

Request

Method: fetch_contact

Request Body

{
  "api_key":"xxxxxxxxxxxxx",     //required
  "action": "fetch_contact",     //required
  "value": {
    "email": 0,                  //required *
    "contact_id": 0,             //required *
  }
}
curl --location --request POST 'https://api.platform.ly' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=xxxxxxxxxxxxx' \
--data-urlencode 'action=fetch_contact' \
--data-urlencode 'value={"email":"[email protected]"}'
<?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=fetch_contact&value=%7B%22email%22%3A%22john.smith%40gmail.com%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=fetch_contact&value=%7B%22email%22%3A%22john.smith%40gmail.com%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=fetch_contact&value={\"email\":\"[email protected]\"}");
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
fetch_contact

value required
JSON formatted string with additional request values

email required *
Contact Valid Email Address.

contact_id required *
Contact ID.


* At least one of the following fields is required: email, contact_id

Response

Returns a JSON contact object with all the information if the request succeeded. Returns an error if the request parameters are invalid.

👍

200 OK

{
    "first_name": "John",
    "last_name": "Smith",
    "email": "[email protected]",
    "id": 0,
    "birthday": 1674663560,
    "website": "https://google.com",
    "phone": "+1 317 787 2271",
    "sms_number": "+1 317 787 2271",
    "fax": "+1 317 787 2271",
    "title": "",
    "company": "Google LLC",
    "address": "225 Avon Ave",
    "address2": "",
    "city": "Indianapolis",
    "state": "Indiana",
    "zip": "46077",
    "country": "United States",
    "picture": "",
    "facebook_profile": "https://www.facebook.com/johnsmith",
    "twitter": "https://twitter.com/johnsmith",
    "linked_in": "https://www.linkedin.com/in/johnsmith/",
    "pinterest": "https://www.pinterest.com/johnsmith/",
    "instagram": "https://www.instagram.com/johnsmith/",
    "date": 1570700563,
    "ip": "95.145.35.241",
    "skype": "johnusername",
    "timezone": "America/Indiana/Indianapolis",
    "last_updated": 1599821918,
    "last_updated_action": "field_update",
    "last_seen": 1610437824,
    "last_seen_action": "contact_sms_click",
    "organization_id": null,
    "organization_role_id": null,
    "role": null,
    "organization": "",
    "project": [
        {
            "id": 0,
            "name": "Project Name",
            "data": {
                "personal_information": {
                    "first_name": "John",
                    "last_name": "Smith",
                    "email": "[email protected]"
                },
                "tags": [],
                "segments": [
                    {
                        "id": 0,
                        "name": "Segment 1"
                    },
                    {
                        "id": 0,
                        "name": "Segment 2"
                    }
                ],
                "custom_fields": [
                    {
                        "id": 0,
                        "name": "Office Address",
                        "value": "225 Avon Ave"
                    },
                    {
                        "id": 0,
                        "name": "Offer Amount",
                        "value": "150000.00"
                    }
                ]
            }
        }
    ],
    "Office Address": "225 Avon Ave",
    "Offer Amount": "150000.00"
}