{% extends "crashstats_base.html" %} {% block page_title %}API Tokens{% endblock %} {% block product_nav_filter %} {% endblock %} {% block site_css %} {{ super() }} {% compress css %} {% endcompress %} {% endblock %} {% block site_js %} {{ super() }} {% compress js %} {% endcompress %} {% endblock %} {% block content %}

API Tokens

You need API Tokens to be able to connect to the API so that the API knows who you are and thus what permissions you have.

Your Generated Tokens

{% for token in your_tokens %}

Generated

{{ token.key[:12] }}{{ token.key[12:] }}...

{{ csrf() }}
{% else %}

You currently have no tokens generated

{% endfor %}

Generate a New Token

{% if form %}
{{ csrf() }} {{ form }}
 
{% else %}

You currentl do not have any permissions to generate tokens for.

{% endif %}

How To Use These

When using the API you must supply these tokens as a header called Token.

Here's an example:

curl -H "Token: 58af2acef8a74dbca9580e2bb8ba9c9a" {{ absolute_base_url }}{{ url('api:model_wrapper', 'GCCrashes') }}

Or, if you prefer Python:

import requests
headers = {'Token': '58af2acef8a74dbca9580e2bb8ba9c9x'}
url = '{{ absolute_base_url }}{{ url('api:model_wrapper', 'GCCrashes') }}'
response = requests.get(url, headers=headers)
{% endblock %}