Przejdź do głównej zawartości

currentApiKey

Dla: Programista

ZapytanieBetaQuery.currentApiKey

The API key this request was made with: its integration, the scopes it may use, when the key and the approval of the integration expire, and the rate limit. Needs no scope, so any valid key may call it: use it to check that a key works.

Wymagany zakresBrak: operację wywoła każdy ważny klucz, niezależnie od zakresów integracji.
Dostępne odPrynt 0.28.0
StabilnośćBeta (co to znaczy)

Argumenty

Operacja nie przyjmuje argumentów.

Zwraca

CurrentApiKey!

Przykład

Zapytanie
query CurrentApiKey {
currentApiKey {
integration {
id
name
}
scopes
hint
expiresAt
approvalExpiresAt
rateLimitPerMinute
}
}
Wywołanie (curl)
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \
-H "Authorization: Bearer $PRYNT_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"query": "query CurrentApiKey {\n currentApiKey {\n integration {\n id\n name\n }\n scopes\n hint\n expiresAt\n approvalExpiresAt\n rateLimitPerMinute\n }\n}"
}
JSON
Odpowiedź
{
"data": {
"currentApiKey": {
"integration": {
"id": "6a1f0c2e-3b4d-4e5f-8a9b-0c1d2e3f4a5b",
"name": "Sklep internetowy"
},
"scopes": [
"orders:read",
"orders:write"
],
"hint": "k3Fq",
"expiresAt": "2027-04-03T00:00:00.000Z",
"approvalExpiresAt": "2027-10-06T00:00:00.000Z",
"rateLimitPerMinute": 120
}
}
}