Uwierzytelnianie
Wyślij klucz API jako token bearer. Ten punkt końcowy nie określa konkretnego uprawnienia w specyfikacji, więc nadaj swojemu kluczowi minimum potrzebnych uprawnień i sprawdź odpowiedź zamiast zakładać.
Miejsce na identyfikator organizacji
Ten punkt końcowy przyjmuje org_id jako parametr zapytania. Pomiń go, a wywołanie obejmie całe drzewo dzierżawy; prześlij go, aby ograniczyć wywołanie do jednej organizacji.
Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.
Wypróbuj
Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.
curl -X POST https://api.zinndigital.com/v1/campaigns/segments \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string>, "definition": <CampaignSegmentNode> }'Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API
Szczegóły
The `definition` is a filter tree over the fields `GET /v1/campaigns/segments/fields` lists, and is validated on write — a definition that cannot be compiled cannot be stored, so a saved segment never explodes at send time in front of an operator who has already scheduled it. ⛔ An empty group (`{"op":"and","children":[]}`) is refused rather than treated as "everybody": a half-built segment must not silently mean the entire estate.
Parametry
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
org_id (query) | string | Nie | Which organization's campaigns to work on. Required only when you hold campaign access on more than one; staff always work on the platform scope and may omit it. |
Treść żądania
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
name | string | Tak | — |
description | string | Nie | — |
definition | CampaignSegmentNode | Tak | A filter tree. Two node shapes and no third: a GROUP (`op` with `children`) or a CONDITION (`field`/`operator`/`value`). `not` takes exactly one child — an n-ary `not` reads as… |
Odpowiedź
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
id | string | Tak | — |
org_id | string | Tak | The segment's OWNER, not the orgs it selects. |
scope | string<platform, reseller> | Tak | — |
name | string | Tak | — |
description | string | Nie | — |
definition | CampaignSegmentNode | Tak | A filter tree. Two node shapes and no third: a GROUP (`op` with `children`) or a CONDITION (`field`/`operator`/`value`). `not` takes exactly one child — an n-ary `not` reads as… |
status | string<active, archived> | Tak | — |
created_by | string | Nie | — |
created_at | string | Nie | — |
updated_at | string | Nie | — |
Błędy, które ten punkt końcowy może zwrócić
401 · 403 · 422