POST
https://api.cryptohopper.com/v1/user/askai/new
Returns the stored Ask AI conversation for a section, or suggested questions when there is none. Send new_session 1 to clear the stored conversation first.
OAuth scope:
read user About scopes
When a conversation is stored, data has a messages array (question, answer, id) instead of suggestions. Conversations are kept for one day.
Example request
curl -X POST "https://api.cryptohopper.com/v1/user/askai/new" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"page":"dashboard","new_session":1}'
const response = await fetch('https://api.cryptohopper.com/v1/user/askai/new', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"page": "dashboard",
"new_session": 1
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/user/askai/new",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"page": "dashboard",
"new_session": 1
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/user/askai/new');
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([
'page' => 'dashboard',
'new_session' => 1,
]),
]);
$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": {
"suggestions": {
"42": {
"id": "42",
"question": "How do I start my bot?",
"answer": "Open your bot's dashboard and switch it on."
}
}
}
}