Authentication

You'll need to authenticate your requests to access some of the endpoints in the Mobile API. In this guide, we'll look at how authentication works. The Mobile API offers OAuth2 with a token.

OAuth2 with bearer token

The way to authenticate with the Mobile API is by using OAuth2. When establishing a connection using OAuth2, you will need your access token.

Here's how to obtain an access token:

Request

POST
/auth/login
curl https://prod-app.themeparkshark.com/api/auth/login \
-H "Accept: application/json" \
-d user=YOUR_USER_ID \
-d identity_token=YOUR_IDENTITY_TOKEN

Response

{
  "data": {
    "id": 1,
    "screen_name": "tomtheshark",
    "token": "1|QnBuiBo7NbgzcGCVmCbCmTxK2uIE0VfQML6h5ha46af7b945",
    // ...
  }
}

The user and identity_token parameters should be populated with those values provided from the ASAuthorizationAppleIDCredential class.

From there, you can now use your token to authenticate your future requests:

Request

GET
/me
curl https://prod-app.themeparkshark.com/api/me \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}

Was this page helpful?