AuthenticationΒΆ
Access to the Ship API is controlled via API tokens. You can retrieve the API token for either yourself or for a Bot user via the User list in the Ship Administration window.
How to locate your API token (Mac Client):
- Launch Ship
- Click on the Ship Menu and choose Administration
- Click on Users
- Find your user account OR create a new user account and mark it as a
Bot
user.- Click on the Tokens link for the account you want to get API access for
- Copy an API token
- Add
Ship [space]
to the beginning of the token (for use with curl, not necessary with python).
Once you have your API token in hand, you can access any of the Ship API endpoints by providing the token in an Authorization header.
For example to fetch Problem #1:
curl:
SHIP_API_TOKEN="Ship <token>" # e.g. Ship 6460d8174eab4b7db4de91cf887c2db2
curl \
--header "Authorization: $SHIP_API_TOKEN" \
https://api.realartists.com/api/20151105/problems/1
python:
import shipapi
api = shipapi.api(token="Your API token here")
p1 = api.problem(1)