GET
https://api.cryptohopper.com/v1/device/authorize
Authorizes the device in the deviceId header with the 6 digit code that was emailed to the account owner. Used by the Cryptohopper mobile apps after signing in on a new device.
This is not the OAuth device authorization grant. The handler checks no OAuth scope. A wrong, expired or malformed code returns 402 Unauthorized. A code allows 5 attempts, and an account is limited to about 15 attempts per 30 minutes. A device that is already authorized returns Authorized without checking the code.
Example request
curl "https://api.cryptohopper.com/v1/device/authorize" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/device/authorize', {
method: 'GET',
headers: {
"access-token": "YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
import requests
response = requests.get(
"https://api.cryptohopper.com/v1/device/authorize",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/device/authorize');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
],
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
code |
string | Optional | Required. The 6 digit code from the device authorization email. Surrounding spaces are allowed. |
Response
{
"data": "Authorized"
}