Sign in with Apple
POST
/v1/auth/apple
const url = 'https://api.pocketbell.dev/v1/auth/apple';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"identity_token":"example","nonce":"example"}'};
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://api.pocketbell.dev/v1/auth/apple \ --header 'Content-Type: application/json' \ --data '{ "identity_token": "example", "nonce": "example" }'Exchanges an Apple identity token for a session, creating the account on first sign-in.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
identity_token
required
The identity token from Apple, as text.
string
nonce
required
The nonce from POST /v1/auth/nonce, unhashed.
string
Examplegenerated
{ "identity_token": "example", "nonce": "example"}Responses
Section titled “Responses”Signed in.
Media typeapplication/json
object
session_token
required
Send as Authorization: Bearer. Shown once.
string
user_id
required
string
Example
{ "user_id": "usr_01jz9k6q8r3tfv0x2m4n5p7s8a"}The request was invalid.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Which fields were wrong, for invalid_request.
Array<object>
object
field
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}The identity token or nonce was not valid.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Which fields were wrong, for invalid_request.
Array<object>
object
field
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}