Skip to main content

Authentication

Rokt Calendar uses the OAuth 2.0 protocol to allow websites or applications to request authorization to access protected calendars without requiring the account user name and password.

OAuth details#

  • Rokt Calendar OAuth supports the client_credentials grant type.
  • OAuth requests are only served over HTTPS.
  • Access tokens expire after five minutes (subject to changes in production environment). For best results, don’t rely on this amount. Instead, use the dynamic value returned in expires_in.
  • Refresh tokens expire after 60 minutes (subject to changes in production environment).

Sample request#

With authorization header#

curl -vX POST https://api.roktcalendar.com/oauth2/token \    --header 'Content-Type: application/x-www-form-urlencoded' \    --header 'Accept: application/json' \    --header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \    -d grant_type=client_credentials'

Without authorization header#

curl -vX POST https://api.roktcalendar.com/oauth2/token \    --header 'Content-Type: application/x-www-form-urlencoded' \    --header 'Accept: application/json' \    -d 'grant_type=client_credentials&client_id=johnsmithmedia&client_secretpassword'

Request fields#

KeyInDescriptionRequired?Example
Authorizationheaderclient_id and client_secret must be included in the authorization header through Basic HTTP authorization and will be provided by your account manager; the header content is Basic base64encode(client_id:client_secret)YesBasic base64encocde(12345:abcde)
Content-TypeheaderMedia type of request must always be application/X-www-form-urlencodedYesapplication/X-www-form-urlencoded
grant_typebodyMust be client_credentialsYesclient_credentials
client_idbodyYour client ID (mandatory if no authorization header)Nousername
client_secretbodyYour client secret (mandatory if no authorization header)Nopassword

Sample response#

{  "access_token": "eyJraWQiOiJNMDJyQmZzT3pNKzRVMjhHRjVuaDdIREphWlIwaytDMlwvNFl5dXYxZ2N0ST0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI0MHN2YmluMGQxOTRzdWJwb2hsMDc5cmhjayIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoicmVwb3J0LWFwaVwvcmVhZC1yZXBvcnQtYXBpIiwiYXV0aF90aW1lIjoxNTg1MTEwMDQxLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtd2VzdC0yLmFtYXpvbmF3cy5jb21cL3VzLXdlc3Qt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