Code Samples

Here are a few simple snippets to get started

cURL

Initially login to get the temporary API key

Command
curl -X 'POST'
'https://api.answr.space/api:auth/auth/login'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "email": "[email protected]", "password": "your_password" }'

Response
{ "authToken": "eyJhbGciOiJBMjU2S1ciLCJlbm", "user": 2 }

Python

Initially login to get the temporary API key

import requests
headers = {
 'accept': 'application/json',
 # Already added when you pass json= but not when you pass data=
 # 'Content-Type': 'application/json',
}
json_data = {
 'email': '[email protected]',
 'password': 'your_password',
}
response = requests.post('https://api.answr.space/api:auth/auth/login', headers=headers, json=json_data)

Response
{ "authToken": "eyJhbGciOiJBMjU2S1ciLCJlbm", "user": 2 }

JavaScript

Initially login to get the temporary API key

MATLAB

Initially login to get the temporary API key

R

Initially login to get the temporary API key

Last updated