Last active
August 6, 2018 04:55
-
-
Save sebbarg/bf8a26ad90d0955ad740efff9e2cf35f to your computer and use it in GitHub Desktop.
Trajectory example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip3 install requests | |
import requests | |
import json | |
from pprint import pprint | |
my_email = 'john@example.com' | |
my_token = 'johns-calculator-token' | |
intake = 35.01 | |
# | |
# Get trajectory | |
# | |
url = "https://api.fit-outcomes.com/v1/calculator/ors_trajectory/get" | |
headers = { | |
"X-Calculator-Email": my_email, | |
"X-Calculator-Token": my_token | |
} | |
parameters = { | |
"intake": intake, | |
"session_count": 25 | |
} | |
r = requests.post(url, headers=headers, data=json.dumps(parameters)) | |
if r.status_code != 200: | |
raise Exception('Trajectory error: ' + json.dumps(r.json())) | |
pprint(r.json()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment