メインコンテンツへスキップ

REST API

公開 REST サーフェスは 3 つのホストにまたがります。フラグとメッセージング用、イベント取り込み用、セッションリプレイ用です。各ホストが独自の 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"

Ingest an event

curl -X POST "https://eu.api.prodantix.com/v1/events" \
  -H "Authorization: Bearer $PRODANTIX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"batch":[{"distinct_id":"u_8f3a","name":"order.completed","properties":{"amount":4200}}]}'

受理は保存を意味しません

取り込み操作は 202 を返します。これはイベントが処理のために受理されたことを意味し、保存されたことは意味しません。不正な形式のイベントは後続の処理で破棄されることがあります。

OpenAPI ドキュメント

各ホストは自身の操作を /openapi.json で提供します。統合ビューが本サイトの API リファレンスページです。