import { Emailr } from 'emailr';
const emailr = new Emailr('em_xxxxxxxxx');
// Get by contact id
const { data, error } = await emailr.contacts.get({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await emailr.contacts.get({
email: '[email protected]',
});
{
"object": "contact",
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"email": "[email protected]",
"first_name": "Steve",
"last_name": "Wozniak",
"created_at": "2023-10-06T23:47:56.678Z",
"unsubscribed": false,
"properties": {
"company_name": "Acme Corp",
"department": "Engineering"
}
}
Retrieve a single contact.
import { Emailr } from 'emailr';
const emailr = new Emailr('em_xxxxxxxxx');
// Get by contact id
const { data, error } = await emailr.contacts.get({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await emailr.contacts.get({
email: '[email protected]',
});
{
"object": "contact",
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"email": "[email protected]",
"first_name": "Steve",
"last_name": "Wozniak",
"created_at": "2023-10-06T23:47:56.678Z",
"unsubscribed": false,
"properties": {
"company_name": "Acme Corp",
"department": "Engineering"
}
}
GET https://api.emailr.dev/contacts/{id}
id or email must be provided.
import { Emailr } from 'emailr';
const emailr = new Emailr('em_xxxxxxxxx');
// Get by contact id
const { data, error } = await emailr.contacts.get({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
});
// Get by contact email
const { data, error } = await emailr.contacts.get({
email: '[email protected]',
});
{
"object": "contact",
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"email": "[email protected]",
"first_name": "Steve",
"last_name": "Wozniak",
"created_at": "2023-10-06T23:47:56.678Z",
"unsubscribed": false,
"properties": {
"company_name": "Acme Corp",
"department": "Engineering"
}
}