Add authentication with OAuth2

PATCH /reservation/api/1/platform/{platform-code}/webhook/auth/oauth2

Activate OAuth2 authentication for webhooks.

Path parameters

  • platform-code string Required

    The unique code assigned to the reservation platform.

    Maximum length is 11. Format should match the following pattern: [a-zA-Z0-9_-]+.

application/json

Body Required

  • authorizationGrantType string

    The authorization grant type. See OAuth2 Grant Types.

    Value is CLIENT_CREDENTIALS. Default value is CLIENT_CREDENTIALS.

  • clientAuthorizationMethod string

    The client authorization method. See OAuth2 Client Authentication.

    Values are CLIENT_SECRET_BASIC, CLIENT_SECRET_JWT, or CLIENT_SECRET_POST. Default value is CLIENT_SECRET_BASIC.

  • clientId string Required

    The OAuth2 client ID.

  • clientName string

    The OAuth2 client name.

  • clientSecret string(password) Required

    The OAuth2 client secret.

  • providerJwkSetUri string(uri)

    The external platform URL for getting public keys to verify given access tokens on the K-Series side.

  • providerTokenUri string(uri) Required

    The external platform URL for getting access tokens by private credentials.

  • scopes array[string]

    The scopes being granted to the API client.

Responses

  • 200 application/json

    Accepted

    Hide response attributes Show response attributes object
    • accepted boolean Required

      Whether the webhook request was accepted.

    • currentAuthType string Required

      The current authentication type.

      Values are BASIC_AUTH, BEARER_TOKEN, API_KEYS, or OAUTH2.

  • 400

    Non relevant request

  • 403

    Scope 'reservation-{platform-code}' not found in the token

  • 404

    Platform not found

PATCH /reservation/api/1/platform/{platform-code}/webhook/auth/oauth2
curl \
 --request PATCH 'https://api.trial.lsk.lightspeed.app/reservation/api/1/platform/MyPlatform/webhook/auth/oauth2' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"authorizationGrantType":"CLIENT_CREDENTIALS","clientAuthorizationMethod":"CLIENT_SECRET_BASIC","clientId":"LightspeedKSeries","clientName":"LightspeedKSeries","clientSecret":"Example-Client-Secret","providerJwkSetUri":"https://my.platform/public-keys","providerTokenUri":"https://my.platform/emitter/token","scopes":["webhooks-api"]}'
Request examples
{
  "authorizationGrantType": "CLIENT_CREDENTIALS",
  "clientAuthorizationMethod": "CLIENT_SECRET_BASIC",
  "clientId": "LightspeedKSeries",
  "clientName": "LightspeedKSeries",
  "clientSecret": "Example-Client-Secret",
  "providerJwkSetUri": "https://my.platform/public-keys",
  "providerTokenUri": "https://my.platform/emitter/token",
  "scopes": [
    "webhooks-api"
  ]
}
Response examples (200)
{
  "accepted": true,
  "currentAuthType": "BASIC_AUTH"
}