POST
https://api.cryptohopper.com/v1/subscription/remap
Reassigns all of the user's active bot subscriptions in one call. mapping is an object with the subscription ID as key (0 for the trial) and the bot ID as value.
OAuth scope:
read manage About scopes
Active subscriptions that are not in mapping are unassigned from their bot.
Example request
curl -X POST "https://api.cryptohopper.com/v1/subscription/remap" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mapping":{"0":987654,"466000":987655}}'
const response = await fetch('https://api.cryptohopper.com/v1/subscription/remap', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"mapping": {
"0": 987654,
"466000": 987655
}
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/subscription/remap",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"mapping": {
"0": 987654,
"466000": 987655
}
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/subscription/remap');
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([
'mapping' => [
'0' => 987654,
'466000' => 987655,
],
]),
]);
$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": "Subscriptions have been reassigned."
}