How to access the api?!?

I’ve wrangled quite a few api’s in my day, however am totally stuck on this one.

I’m using the documentation on this page, but cant figure out how to get past step one.

Below is my simple python code using the requests library.

Can someone please tell me wtf im doing wrong?
Sincerely, ZACK

In [10]:
import requests

header = {"Accept": "application/json", 
           "Content-Type": "application/json"}

payload = {"username":"kingzack",
           "password": "top-secret-yo"}


endpoint = "https://api.hooktheory.com/v1/users/auth/"
requests.post(endpoint, headers=header, data=payload)


Out[10]:
<Response [404]>

There’s no trailing slash on the auth endpoint.

1 Like

Muhahaha, that worked! Thanks Semanticist!
Below is code that works incase anyone else runs into this issue.

import requests

header = {"Accept": "application/json", 
          "Content-Type": "application/json",
          "username":"kingzack",
          "password": "forggettaboudit"}


url = "https://api.hooktheory.com/v1/users/auth"
r = requests.post(url, data=header)
print r.json()
Out[10]:
          {u'activkey': u'XXXXXXXXXXXXXXXXXXXX',
           u'id': 6969696969,
           u'username': u'kingzack'}