Skip to content

Get Contact by ID

Gets a specific contact using its unique identifier.

ParameterTypeRequiredDescription
idstringYesUnique contact ID
{
"id": "contact-uuid-123",
"name": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "3001234567",
"countryCode": "57",
"status": "ACTIVE",
"birthDate": "1990-01-15T00:00:00.000Z",
"origin": "API",
"organizationId": "org-uuid",
"customValues": [],
"tags": [
{
"id": "tag1-uuid",
"name": "VIP Client",
"description": "Important clients",
"color": "#FF5722",
"organizationId": "org-uuid",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}
CodeDescription
400Invalid contact ID
401Missing or invalid API Key
404Contact not found
500Internal server error
Ventana de terminal
curl -X GET "https://app.sendme123.com/api/contacts/contact-uuid-123" \
-H "api-key: your-api-key-here" \
-H "Content-Type: application/json"
const contactExists = async (contactId) => {
try {
await axios.get(`https://app.sendme123.com/api/contacts/${contactId}`, {
headers: { 'api-key': 'your-api-key-here' }
});
return true;
} catch (error) {
return false;
}
};
const safeUpdateContact = async (contactId, newData) => {
try {
// First verify it exists
const currentContact = await axios.get(`https://app.sendme123.com/api/contacts/${contactId}`, {
headers: { 'api-key': 'your-api-key-here' }
});
// Proceed with update
const response = await axios.patch(`https://app.sendme123.com/api/contacts/${contactId}`, newData, {
headers: {
'api-key': 'your-api-key-here',
'Content-Type': 'application/json'
}
});
console.log('Contact updated:', response.data);
return response.data;
} catch (error) {
if (error.response?.status === 404) {
throw new Error('Contact not found');
}
console.error('Error updating contact:', error.response?.data || error.message);
throw error;
}
};