API-и паёмрасон
Ҳар чизе, ки панел бо аккаунти пайвастшудаи Instagram, WhatsApp ё Telegram карда метавонад, тавассути REST — як калид, як шакли посух, фасл ба фасл.
Тамосҳо (кортаи CRM)
Тегҳо, тағйирёбандаҳо, холҳо, рефералҳо ва пайвандҳои пайгиришавандаи ҳар тамос. Дар Telegram, WhatsApp ва Instagram якхела.
The contact card is shared by every network: {id} may be a Telegram account, wa_{id} or ig_{id}. Tags, variables and points are the same ones rules, scenarios and templates use ({{contact.x}}, {{points}}, {{rank}}).
Base URL: https://chatvendor.net/api/v1 · every response is {"success": true, "data": …}
GET
/channels/{id}/contacts
Contact cards (tags, variables, points, referrals); id = Telegram account, wa_{id} or ig_{id}. Query: tag, q, var, limit, offset
channels:read
Scope: channels:read
Parameters
idpath · integerrequiredChannel id (from GET /channels)
Response 200 · Contact[]
peer_id integertitle stringusername stringtype stringtags string[]vars objectpoints integerreferrals_count integerreferrer_peer_id integerref_code stringref_link stringnotes stringconverted_at string (date-time)last_message_at string (date-time)
curl https://chatvendor.net/api/v1/channels/1/contacts \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/channels/{id}/contacts/{peer}
One contact card
channels:read
Scope: channels:read
Parameters
idpath · integerrequiredChannel id (from GET /channels)
peerpath · stringrequiredTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Response 200 · Contact
peer_id integertitle stringusername stringtype stringtags string[]vars objectpoints integerreferrals_count integerreferrer_peer_id integerref_code stringref_link stringnotes stringconverted_at string (date-time)last_message_at string (date-time)
curl https://chatvendor.net/api/v1/channels/1/contacts/@username \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
PATCH
/channels/{id}/contacts/{peer}
Change tags / variables / notes of a contact
channels:write
Scope: channels:write
Parameters
idpath · integerrequiredChannel id (from GET /channels)
peerpath · stringrequiredTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Body (application/json)
tagsstring[]add_tagsstring[]remove_tagsstring[]varsobjectnotesstringResponse 200 · Contact
peer_id integertitle stringusername stringtype stringtags string[]vars objectpoints integerreferrals_count integerreferrer_peer_id integerref_code stringref_link stringnotes stringconverted_at string (date-time)last_message_at string (date-time)
curl -X PATCH https://chatvendor.net/api/v1/channels/1/contacts/@username \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '[]'
GET
/instagram/follows
Does @username follow your connected Instagram account (true / false)
channels:read
Scope: channels:read
Parameters
usernamequery · stringrequiredaccountquery · stringResponse 200
OK
curl https://chatvendor.net/api/v1/instagram/follows?username=… \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/{id}/contacts/{peer}/points
Add / deduct points (ref deduplicates)
channels:write
Scope: channels:write
Parameters
idpath · integerrequiredChannel id (from GET /channels)
peerpath · stringrequiredTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Body (application/json)
deltaintegerreasonstringrefstringResponse 200
OK
curl -X POST https://chatvendor.net/api/v1/channels/1/contacts/@username/points \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"delta":1,"reason":"…","ref":"…"}'
GET
/channels/{id}/leaderboard
Points leaderboard
channels:read
Scope: channels:read
Parameters
idpath · integerrequiredChannel id (from GET /channels)
Response 200
OK
curl https://chatvendor.net/api/v1/channels/1/leaderboard \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/channels/{id}/links
Tracked links ({{link:name}} placeholders) with click counts
channels:read
Scope: channels:read
Parameters
idpath · integerrequiredChannel id (from GET /channels)
Response 200
OK
curl https://chatvendor.net/api/v1/channels/1/links \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/{id}/links
Create / update a tracked link
channels:write
Scope: channels:write
Parameters
idpath · integerrequiredChannel id (from GET /channels)
Body (application/json)
namestringurlstringtagstringpeer_idintegerResponse 200
OK
curl -X POST https://chatvendor.net/api/v1/channels/1/links \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '[]'