စစ်မှန်ကြောင်း အတည်ပြုခြင်း
API သော့တစ်ခုကို bearer token အဖြစ် ပို့ပါ။ သော့တွင် apikeys.manage ခွင့်ပြုချက် ပါရှိရမည်ဖြစ်ပြီး၊ ၎င်းမပါရှိသော သော့ကို 404 အစား 403 ဖြင့် ငြင်းပယ်ပါမည်။
သင့်အဖွဲ့အစည်း၏ id ထည့်သွင်းရမည့်နေရာ
ဤအစွန်းဆုံးနေရာသည် JSON ခန္ဓာကိုယ်အတွင်းရှိ ကွင်းတစ်ခုအနေဖြင့် org_id ကို ယူပါသည်။
သင့်အဖွဲ့အစည်း id သည် သင်၏ ဒက်ရှ်ဘုတ်ရှိ API သော့များ မျက်နှာပြင်တွင်၊ သော့၏ ဘေး၌ ရှိပါသည်။ ၎င်းသည် သင်ပြုလုပ်သည့် ခေါ်ဆိုမှုတိုင်းတွင် တူညီသော id ဖြစ်ပါသည်။
စမ်းကြည့်ရန်
ထောင့်ချိတ်များအတွင်းရှိ မည်သည့်အရာကိုမဆို သင်၏ကိုယ်ပိုင်တန်ဖိုးများဖြင့် အစားထိုးပြီး သင့်ဒက်ရှ်ဘုတ်မှ သော့ချက်တစ်ခုဖြင့် key ကို အစားထိုးပါ။
curl -X POST https://api.zinndigital.com/v1/api-keys \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string> }'ဝင်ရောက်ပြီးပြီလား။ သင့်ဒက်ရှ်ဘုတ်ရှိ API ကွန်ဆိုးလ်တွင် သင့်၏ တကယ့်အဖွဲ့အစည်း ID နှင့် သင့်ကိုယ်ပိုင်သော့ချက်တို့ဖြင့် ဖြည့်သွင်းပေးပြီး တကယ့်တုံ့ပြန်ချက်ကို သင်မြင်နိုင်ရန် တိုက်ရိုက် API (live API) ကို အသုံးပြု၍ တောင်းဆိုမှုကို လုပ်ဆောင်ပေးပါသည်။ ဤအဆုံးသတ်အမှတ် (endpoint) ကို API ကွန်ဆိုးလ်တွင် ဖွင့်ပါ
အသေးစိတ်အချက်အလက်များ
Mints a new per-org API key and returns the full `zdk_…` token **once** — only its hash is stored, so a lost token is replaced, never recovered. The requested `scopes` must be permissions the caller already holds in the target org; asking for one you do not hold is a `403` (a key can never out-scope its creator). Send an `Idempotency-Key` so a retry after a lost response returns the same token rather than orphaning a key. Requires `apikeys.manage`.
ကန့်သတ်ဘောင်များ
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
Idempotency-Key (header) | string | မဟုတ်ပါ | Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. |
တောင်းဆိုချက် ကိုယ်ထည်
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
name | string | ဟုတ်ကဲ့ | — |
scopes | string[] | မဟုတ်ပါ | RBAC permission keys to grant. Each must be a permission the caller holds in the target org (a key can never out-scope its creator); an unheld scope is a `403`, an unknown one a… |
sandbox | boolean | မဟုတ်ပါ | Mint a sandbox (test-mode) key. Defaults to false. |
org_id | Uuid | null | မဟုတ်ပါ | The organization the key belongs to. Defaults to the caller's org; the caller must hold `apikeys.manage` in the target org. |
တုံ့ပြန်ချက်
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
id | Uuid | ဟုတ်ကဲ့ | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
name | string | ဟုတ်ကဲ့ | — |
prefix | string | ဟုတ်ကဲ့ | The key's public lookup id (the middle segment of the token). |
scopes | string[] | ဟုတ်ကဲ့ | The RBAC permission keys this key may exercise. |
sandbox | boolean | ဟုတ်ကဲ့ | A sandbox (test-mode) key suppresses billing + provisioning (docs/09 §2). |
last_used_at | object | မဟုတ်ပါ | When the key last authenticated a request; null if never used. |
revoked_at | object | မဟုတ်ပါ | Always null on a listed/fetched key — revoked keys are not returned. |
created_at | string | ဟုတ်ကဲ့ | — |
token | string | ဟုတ်ကဲ့ | The full `zdk_<mode>_<prefix>_<secret>` token. Shown **once, here only** — store it now; it cannot be retrieved again, only replaced. |
ဤအမှတ်ဆက်မှ ပြန်ပေးနိုင်သော အမှားများ
401 · 403 · 409 · 422 · 429