{% extends "symbols/base.html" %} {% block site_css %} {{ super() }} {% endblock %} {% block content_inner %}

Scripted API Upload

{% if has_possible_token %}

Now that you have an actively working API Token that has the {{ required_permission.name }} permission you can use the API to upload your symbols files.

The URL you need to HTTP POST to is:
{{ absolute_base_url }}{{ url('symbols:upload') }}

What you need to do is the following:

You can either send the file as a application/x-www-form-urlencoded (pushing the binary blob of data as the request body without a name) or multipart/form-data (specifying a filename for each binary blob of data).
If no filename is passed, the file is assumed to be a .zip file (aka. application/zip).


Example using cURL

curl -X POST -H "Auth-Token: XXXYOURAPITOKENXXX" --form myfile.zip=@path/to/myfile.zip {{ absolute_base_url }}{{ url('symbols:upload') }}

Example using Python and requests

>>> url = '{{ absolute_base_url }}{{ url('symbols:upload') }}'
>>> files = {'myfile.zip': open('path/to/myfile.zip', 'rb').read()}
>>> response = requests.post(url, files=files, headers={'Auth-token': 'XXXYOURAPITOKENXXX'})
>>> request.status_code
201

If the file you posted could be accepted and opened, the API will respond with the error code 201 Created and the response body OK.

{% else %}

To be able to upload by a script, using the API, you need to generate an API Token that has the permission {{ required_permission.name }}.
Once you have that set up, return here to read about how to use it.

{% endif %}

Go back to Symbols Upload page

{% endblock %}