API Additional Token Instructions

As of our 2.7.0 release on July 17th 2019 we require an API token be passed with every request.

A user can create an API token by following these steps:

1. Log into https://openapparel.org

2. Select "Settings" from the user menu.

Image shows a screenshot of settings in the OAR.

3. Select the Tokens tab and then "GENERATE A NEW API TOKEN."

4. Click the "copy" button to copy the new key to the clipboard.

Additional notes on API tokens:

  • Each user account can have a single API token. The token can be deleted and recreated at any time.

  • The token is equivalent to a password and should be kept secret. Requests made with the token have the same permissions as the user account under which the token was created.

  • Include the token in requests by passing it in an "Authorization" header with a "Token " prefix:

curl -X GET --header "Authorization: Token ac89fe72....." 'https://openapparel.org/api/facilities/'

  • When using the "Try it out" forms in the Swagger API documentation, you must either log in to the application or use the "Authorize" button and enter Token YOUR_TOKEN_VALUE in the "value" box. The "Token" prefix is required.

Learn more about the OAR API and how it works on our API page.