REST API
Avalik REST-pind hõlmab kolme hosti: üks lippude ja sõnumite jaoks, üks sündmuste vastuvõtuks ja üks seansi taasesituseks. Igaüks pakub oma OpenAPI dokumenti.
| Host | Serves | OpenAPI |
|---|---|---|
| https://api.prodantix.com | Flags, messaging, GraphQL | https://api.prodantix.com/openapi.json |
| https://eu.api.prodantix.com | Event ingestion (EU) | https://eu.api.prodantix.com/openapi.json |
| https://eu.replay.prodantix.com | Session replay (EU) | https://eu.replay.prodantix.com/openapi.json |
Autentimine
Iga REST-operatsioon võtab projektivõtme Bearer-tokenina. Projektivõtmed kehtivad ühe projekti kohta; ära kunagi pane salajast võtit kliendipoolsesse koodi.
JSON
{
"Authorization": "Bearer <project key>"
}Operations
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/flags | Evaluate every flag for a distinct id |
| GET | /v1/flags/snapshot | Fetch the project's full ruleset for local evaluation |
| GET | /v1/messages | Read a user's in-app inbox |
| POST | /v1/messages/read | Mark an in-app message read |
| POST | /v1/events | Ingest a batch of events |
| POST | /v1/identify | Identify a user and set traits |
| POST | /v1/group | Associate a user with a group |
| POST | /v1/replay | Upload 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"const response = await fetch('https://api.prodantix.com/v1/flags?distinct_id=u_8f3a', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const flags = await response.json();final response = await http.get(
Uri.parse('https://api.prodantix.com/v1/flags?distinct_id=u_8f3a'),
headers: {'Authorization': 'Bearer $apiKey'},
);response = requests.get(
"https://api.prodantix.com/v1/flags",
params={"distinct_id": "u_8f3a"},
headers={"Authorization": f"Bearer {api_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 dokumendid
Iga host pakub oma operatsioone aadressil /openapi.json. Liidetud vaade on selle saidi API viite leht.