PATCH
https://api.cryptohopper.com/v1/hopper/{id}/setdefaulthopper
Makes this hopper the user's default hopper and returns the user's hoppers.
OAuth scope:
read manage About scopes
The response is the same list as GET /hopper, with every field of each hopper; the example is shortened.
Example request
curl -X PATCH "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/setdefaulthopper" \
-H "access-token: YOUR_ACCESS_TOKEN"
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/setdefaulthopper', {
method: 'PATCH',
headers: {
"access-token": "YOUR_ACCESS_TOKEN"
}
});
const data = await response.json();
import requests
response = requests.patch(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/setdefaulthopper",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/setdefaulthopper');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
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. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Response
{
"data": {
"hoppers": [
{
"id": "123456",
"open_positions_count": "3",
"name": "My BTC bot",
"exchange": "binance",
"set_default": "1",
"enabled": 1
}
]
}
}