Example ID Request
$ curl \
https://api.intercom.io/contacts/5811f6bbe6b4704ddfa84ac0 \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept:application/json'
or
$ curl \
-s https://api.intercom.io/contacts?user_id=77177570-cf5d-4f1a-bc75-75202af47d4f \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept:application/json'
HTTP/1.1 200 OK
{
"type": "contact",
"id": "5811f6bbe6b4704ddfa84ac0",
"user_id": "77177570-cf5d-4f1a-bc75-75202af47d4f",
"anonymous": true,
"email": "[email protected]",
"phone": "00353875551234",
"name": "O'Brien",
"pseudonym": "Lime Camel from Dublin",
...
}
# NB: Full Contact objects are returned
contact = intercom.contacts.find(:id => "530370b477ad7120001d")
contact = intercom.contacts.find(:user_id => "8a88a590-e1c3-41e2-a502-e0649dbf721c")
Contact contact = Contact.findByID("530370b477ad7120001d");
contact = Contact.findByUserID("8a88a590-e1c3-41e2-a502-e0649dbf721c");
<?php
$lead = $intercom->leads->getLead("596f6b60d797879302bd7ac1");
print_r($lead->email);
?>
or
<?php
// Rememebr that user_ids for leads are
// generated automatically so look different
// from the user_ids you manually create for users
$lead = $intercom->leads->
getLead("", ["user_id" => "ce12a681-e3d4-4a17-bbde-fe85e04ca3ef"]);
print_r($lead);
?>
Leads can be looked up individually via their id
, or with a user_id
parameter.
user_id for leads
Remember that for leads the user_id will be automatically generated so it will look something like '8a88a590-e1c3-41e2-a502-e0649dbf721c'. (Note that this user_id is not retained when converting a lead to a user) For users the user_id is manually set so it will generally appear more like a regular number series e.g. '234'.