تخطَّ إلى المحتوى الرئيسي

واجهة REST

يعمل سطح REST العام على ثلاثة مضيفين: واحد للرايات والرسائل، وواحد لاستيعاب الأحداث، وواحد لإعادة تشغيل الجلسات. كل منها يقدّم مستند OpenAPI الخاص به.

HostServesOpenAPI
https://api.prodantix.comFlags, messaging, GraphQLhttps://api.prodantix.com/openapi.json
https://eu.api.prodantix.comEvent ingestion (EU)https://eu.api.prodantix.com/openapi.json
https://eu.replay.prodantix.comSession replay (EU)https://eu.replay.prodantix.com/openapi.json

المصادقة

تقبل كل عملية REST مفتاح المشروع كرمز Bearer. مفاتيح المشاريع خاصة بمشروع واحد؛ لا تضع مفتاحًا سريًا في كود يعمل على جهة العميل.

JSON
{
  "Authorization": "Bearer <project key>"
}

Operations

MethodPathPurpose
GET/v1/flagsEvaluate every flag for a distinct id
GET/v1/flags/snapshotFetch the project's full ruleset for local evaluation
GET/v1/messagesRead a user's in-app inbox
POST/v1/messages/readMark an in-app message read
POST/v1/eventsIngest a batch of events
POST/v1/identifyIdentify a user and set traits
POST/v1/groupAssociate a user with a group
POST/v1/replayUpload a session replay chunk

Evaluate flags for a user

curl "https://api.prodantix.com/v1/flags?distinct_id=u_8f3a" \
  -H "Authorization: Bearer $PRODANTIX_KEY"

The three ingestion operations (/v1/events, /v1/identify, /v1/group) have their own reference: the Ingest API page carries the batch shape, the envelope rules and what a 202 does and does not promise.

مستندات OpenAPI

يقدّم كل مضيف عملياته الخاصة على ‎/openapi.json‎. العرض المدمج معروض في صفحة مرجع واجهة البرمجة بهذا الموقع.