Get a contact with its labels and assigned team members. If the phone number is not a contact yet, it is created.
Required: phone.
Response: data = {id, phone, labels[], moderators[]}, plus whatsapp_bsuid, whatsapp_username and phone_available where WhatsApp usernames are on (see below).
WhatsApp usernames (only for workspaces with WhatsApp username support switched on; absent otherwise). phone keeps its meaning.
whatsapp_bsuid— Meta's ID for a customer who hides their number behind a WhatsApp username, e.g.EG.2288384708632117. Not a phone number;nullwhen Meta sent none.whatsapp_username— the customer's WhatsApp @username, without the@. Display only;nullwhen none.phone_available—falsewhen the customer keeps their number private: do not SMS, call or storephoneas a number.
Validation errors return HTTP 422 {"message": "error", "data": "<first error>"}.
কোয়েরি প্যারামিটার
| প্যারামিটার | আবশ্যক | উদাহরণ | বিবরণ |
|---|---|---|---|
phone |
হ্যাঁ | {{phone}} |
Contact phone number |
উদাহরণ অনুরোধ
curl -G "https://letsbot.net/api/v1/live_chat/contact" \
-H "Authorization: Bearer YOUR_LB_API_KEY" \
-H "Accept: application/json" \
--data-urlencode "phone=9665xxxxxxxx"
const response = await fetch("https://letsbot.net/api/v1/live_chat/contact?phone=%7B%7Bphone%7D%7D", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_LB_API_KEY",
"Accept": "application/json",
},
});
const data = await response.json();
console.log(data);
<?php
$ch = curl_init('https://letsbot.net/api/v1/live_chat/contact?phone=%7B%7Bphone%7D%7D');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_LB_API_KEY',
'Accept: application/json',
],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);
import requests
response = requests.request(
"GET",
"https://letsbot.net/api/v1/live_chat/contact",
headers={
"Authorization": "Bearer YOUR_LB_API_KEY",
"Accept": "application/json",
},
params={
"phone": "9665xxxxxxxx",
},
)
print(response.json())
উত্তর
Contact200
{
"data": {
"id": 42,
"phone": "966500000000",
"labels": [
{
"id": 5,
"name": "VIP",
"name_translations": {
"en": "VIP"
},
"color": "#6D28D9",
"status": null
}
],
"moderators": [
{
"id": 3,
"name": "Sara Ahmed",
"email": "sara@example.com",
"phone": "966511111111",
"is_ai_agent": false
}
],
"whatsapp_bsuid": null,
"whatsapp_username": "ahmed_store",
"phone_available": true
}
}