createIOSStudioSession
const url = 'https://example.com/api/v1/oauth/ios-session';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"grant_type":"authorization_code","client_id":"tilecast-ios","code":"example","redirect_uri":"https://example.com","code_verifier":"example","refresh_token":"example","studio_session":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/oauth/ios-session \ --header 'Content-Type: application/json' \ --data '{ "grant_type": "authorization_code", "client_id": "tilecast-ios", "code": "example", "redirect_uri": "https://example.com", "code_verifier": "example", "refresh_token": "example", "studio_session": false }'Public and rate-limited. The Tilecast for iOS bootstrap. With authorization_code, exchanges a single-use code issued to tilecast-ios with its PKCE verifier and the callback tilecast-ios://oauth/callback, sets a normal HttpOnly Studio session cookie, and returns the grant’s native credential. With refresh_token, rotates a tilecast-ios refresh token and sets a new Studio session cookie only when studio_session is true. When the session cannot start during a refresh, the rotated credential is still returned with authenticated false and no cookie. A refresh token of any other client is refused before it is consumed. The Studio session belongs to the grant: revoking the grant ends the session, and signing the session out revokes the grant. The app imports the cookie into the configured server’s isolated WebKit data store and keeps the credential out of the web view.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Authorization_code only.
Authorization_code only: tilecast-ios://oauth/callback.
Authorization_code only.
Refresh_token only.
Refresh_token only. Also start a new Studio session and set its cookie, replacing the grant’s earlier session. An authorization_code exchange always sets the cookie.
Responses
Section titled “ Responses ”The native credential, and a Studio session cookie when authenticated is true
object
object
Whether the response set a Studio session cookie.
The grant’s native credential. A server released before native API access omits it, and the app then uses Studio only.
object
Example
{ "data": { "credential": { "token_type": "Bearer" } }}Headers
Section titled “Headers”Invalid, expired, used, mismatched, or revoked code or refresh token, or a refresh token of another client
The account is no longer active
Too many authentication attempts