curl -X POST https://api.magpipe.ai/functions/v1/get-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone_number": "+14155551234"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234'
}),
}
);
const contact = await response.json();
console.log('Contact:', contact.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'phone_number': '+14155551234'}
)
contact = response.json()
print(f"Contact: {contact['name']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": "Prefers morning appointments",
"tags": ["customer", "vip"],
"metadata": {
"customer_id": "cust_123"
},
"stats": {
"total_calls": 5,
"total_messages": 12,
"last_contact": "2024-01-15T10:30:00Z"
},
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
Contacts
Get Contact
Retrieve a contact by ID or phone number
POST
/
get-contact
curl -X POST https://api.magpipe.ai/functions/v1/get-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone_number": "+14155551234"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234'
}),
}
);
const contact = await response.json();
console.log('Contact:', contact.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'phone_number': '+14155551234'}
)
contact = response.json()
print(f"Contact: {contact['name']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": "Prefers morning appointments",
"tags": ["customer", "vip"],
"metadata": {
"customer_id": "cust_123"
},
"stats": {
"total_calls": 5,
"total_messages": 12,
"last_contact": "2024-01-15T10:30:00Z"
},
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
Get detailed information about a contact including their conversation history summary.
Request Body
Provide eithercontact_id or phone_number:
Response
Conversation statistics:
total_calls: Number of callstotal_messages: Number of SMS messageslast_contact: Last interaction time
curl -X POST https://api.magpipe.ai/functions/v1/get-contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone_number": "+14155551234"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-contact',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone_number: '+14155551234'
}),
}
);
const contact = await response.json();
console.log('Contact:', contact.name);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-contact',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'phone_number': '+14155551234'}
)
contact = response.json()
print(f"Contact: {contact['name']}")
{
"id": "c1d2e3f4-5678-9abc-def0-123456789abc",
"phone_number": "+14155551234",
"name": "John Smith",
"email": "john@example.com",
"company": "Acme Corp",
"notes": "Prefers morning appointments",
"tags": ["customer", "vip"],
"metadata": {
"customer_id": "cust_123"
},
"stats": {
"total_calls": 5,
"total_messages": 12,
"last_contact": "2024-01-15T10:30:00Z"
},
"created_at": "2024-01-10T10:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}