POST
https://api.cryptohopper.com/v1/user/mobilepushnotifications
Turns push notification types on or off for the user's mobile app. Send a settings object with the type as key and 1 or 0 as value; types you leave out keep their setting.
OAuth scope:
user About scopes
Accepted types: config_error, on_first_start, on_trigger, on_panic_start, on_panic_end, order_placed, trade_completed, order_cancelled. Other keys, and values other than 0 or 1, are ignored.
Example request
curl -X POST "https://api.cryptohopper.com/v1/user/mobilepushnotifications" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"settings":{"order_placed":1,"trade_completed":1,"order_cancelled":0}}'
const response = await fetch('https://api.cryptohopper.com/v1/user/mobilepushnotifications', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"settings": {
"order_placed": 1,
"trade_completed": 1,
"order_cancelled": 0
}
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/user/mobilepushnotifications",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"settings": {
"order_placed": 1,
"trade_completed": 1,
"order_cancelled": 0
}
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/user/mobilepushnotifications');
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([
'settings' => [
'order_placed' => 1,
'trade_completed' => 1,
'order_cancelled' => 0,
],
]),
]);
$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": "mobile notifications settings have been updated successfully"
}