सामग्री पर जाएँ
लाइव डेमो

प्रमाणीकरण

Exchange your key id + secret for a short-lived bearer token. Send it as `Authorization: Bearer …` together with `X-API-Key: {client_id}` on every call.

post/v1/oauth/token

  • प्रमाणीकरण आवश्यक

अनुरोध बॉडी

  • grant_typestring

    Must be `client_credentials`.

  • client_idstring

    Your key id (`dt_live_…` / `dt_sbx_…`).

  • client_secretstring

    Your client secret.

  • scopestring

    Optional space-separated subset of your granted scopes.

उदाहरण
{
  "grant_type": "string",
  "client_id": "string",
  "client_secret": "string",
  "scope": "string"
}

प्रतिक्रियाएँ

200OKTokenResponse

  • accessTokenstring
  • tokenTypestring
  • expiresIninteger (int32)
  • scopestring

    Space-separated scopes the token carries.

  • environmentstring

    Which environment this token is valid on.

  • 400Bad RequestRFC 7807 समस्या विवरण
  • 401UnauthorizedRFC 7807 समस्या विवरण

कोड नमूने

पूरे प्रोग्राम जो अनुरोध पर उसी तरह हस्ताक्षर करते हैं जैसे गेटवे उसे सत्यापित करता है। YOUR_KEY_ID और YOUR_SECRET बदलें।

curl -X POST "https://api.dubaitrip.com/v1/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_KEY_ID" \
  -d "client_secret=YOUR_SECRET"