Bearer auth. Cursor pagination. Idempotency keys. Webhooks موقّعة. الـ API التي كان فريقك سيبنيها لو امتلك عطلة نهاية الأسبوع.
اختر بيئة التشغيل
import InstantReply from '@instantreply/node'
const ir = new InstantReply({ apiKey: process.env.IR_API_KEY })
for await (const c of ir.conversations.list.autoPaginate({ status: 'active' })) {
if (c.last_message_preview?.includes('refund')) {
await ir.conversations.update(c.id, { tags: ['priority:refund'] })
}
}سطح v1
/v1/conversations/v1/conversations/:id/v1/conversations/:id/v1/conversations/:id/messages/v1/conversations/:id/messages/v1/contacts/v1/contacts/:id/v1/contacts/:id/v1/channels/v1/analytics/summary/v1/usage/v1/webhooks/v1/webhooks/v1/webhooks/:idالتصميم
كل endpoint قائمة يُرجع has_more وnext_cursor. لا سجلات مفقودة تحت الحمل، لا off-by-one.
مرّر UUID وأعد المحاولة بأمان لمدة 24 ساعة. تنطلق الآثار الجانبية مرة واحدة فقط.
أَلصِق المعرّف في الدعم ونتتبّع النداء بالضبط، والردّ بالضبط، والنداء التابع بالضبط.
نفس غلاف JSON في كل فشل. code وmessage وdoc_url وrequest_id. بلا null مفاجئ.
الأخطاء
بلا أعلام نجاح متداخلة. بلا خلط حالة الأحرف. بلا 200 صامت عند الفشل. إذا انكسر النداء، يخبرك الجسم بالضبط أي نداء وماذا توقّع وأين الوثائق.
// 422 Unprocessable Entity
{
"error": {
"code": "INVALID_PLATFORM",
"message": "Channel 'tiktok' is not yet supported on v1.",
"doc_url": "https://www.instantreply.co/api-docs#errors",
"request_id": "req_8f2a0b1c"
}
}