GET
https://api.cryptohopper.com/v1/device/code
Emails a new 6 digit authorization code for the device in the deviceId header to the account owner, to be entered with Authorize a device with an emailed code. The device must already be registered, which happens when it signs in.
The handler checks no OAuth scope. A new code can be requested at most once every 30 seconds; sooner returns 405. An already authorized device returns 400 Device already authorized.
Example request
curl "https://api.cryptohopper.com/v1/device/code" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/device/code', {
method: 'GET',
headers: {
"access-token": "YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
import requests
response = requests.get(
"https://api.cryptohopper.com/v1/device/code",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/device/code');
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. |
Response
{
"data": "Code sent"
}