POST
https://api.cryptohopper.com/v1/subscription/assign
Assigns one of the user's subscriptions to a bot. Use subscription_id 0 for the trial subscription and hopper_id 0 to unassign it.
OAuth scope:
read manage About scopes
Example request
curl -X POST "https://api.cryptohopper.com/v1/subscription/assign" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"subscription_id":466000,"hopper_id":987654}'
const response = await fetch('https://api.cryptohopper.com/v1/subscription/assign', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"subscription_id": 466000,
"hopper_id": 987654
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/subscription/assign",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"subscription_id": 466000,
"hopper_id": 987654
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/subscription/assign');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'subscription_id' => 466000,
'hopper_id' => 987654,
]),
]);
$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": "Subscription has been reassigned."
}