Older API
After successfully verifying user's email or phone number, you'll receive Cotter's Identity Token. Pass it to the body of the request under field
identity_token
curl -XPOST \
-H 'API_KEY_ID: <YOUR API KEY ID>' \
-H 'API_SECRET_KEY: <YOUR API SECRET KEY>' \
-H "Content-type: application/json" \
-d '{
"grant_type": "identity_token",
"identity_token": { // 👈 Put Identity Token Here
"expire_at": "1588849208",
"identifier": "[email protected]",
"identifier_id": "e8a47aff-f520-4b8d-952b-79d36d10fb3e",
"identifier_type": "EMAIL",
"receiver": "<YOUR API KEY ID>",
"signature": "21P6mXSF2x357kZGkEMQTRTn3r...",
"timestamp": "1586257208"
}
}' 'https://www.cotter.app/api/v0/token'
post
https://www.cotter.app
/api/v0/token
Getting Tokens using Identity Token
After successfully authenticating users using Trusted Devices, you will receive Cotter's Event Token. Pass it to the body of the request under field
event_token
curl -XPOST \
-H 'API_KEY_ID: <YOUR API KEY ID>' \
-H 'API_SECRET_KEY: <YOUR API SECRET KEY>' \
-H "Content-type: application/json" \
-d '{
"grant_type": "event_token",
"event_token": { // 👈 Put Event Token Here
"CreatedAt": "2020-04-07T11:09:03.246703978Z",
"DeletedAt": null,
"ID": 264,
"UpdatedAt": "2020-04-07T11:09:03.246703978Z",
"approved": true,
"client_user_id": "xyzABC123",
"event": "LOGIN",
"ip": "73.15.208.6",
"issuer": "<YOUR API KEY ID>",
"location": "San Francisco",
"method": "TRUSTED_DEVICE",
"new": false,
"signature": "CLQUgAUEuMebLAEQ...",
"timestamp": "1586257743"
}
}' 'https://www.cotter.app/api/v0/token'
post
https://www.cotter.app
/api/v0/token
Getting Tokens using Event Token