{% extends "base.html" %} {% load i18n %} {% block main-content %}
{% trans "If you are interested in any other data that is not provided by this API, please contact us via the ticketing system (you must be registered in order to create a ticket)." %}
{% trans "Colab API works through HTTP/REST, always returning JSON objects." %}
{% trans "The base API URL is" %}: {% url 'api_v1_top_level' api_name='v1' as BASE_API_URL %} {{ BASE_API_URL }}
{% trans "Each model listed below has a resource_uri field available, which is the object's data URI." %}
{% trans "The following list contains the available models to retrieve data and its fields available for filtering" %}:
{% trans "The email field is not shown for user's privacy, but you can use it to filter" %}
{% trans "The address field is not shown for user's privacy, but you can use it to filter" %}
...{{ BASE_API_URL }}wiki/?name={% trans "WikiName" %}
{% trans "Where "name" is the fieldname and "WikiName" is the value you want to filter." %}
{% trans "You can also filter using Django lookup fields with the double underscores, just as below" %}
...{{ BASE_API_URL }}wiki/?wiki_text__startswith={% trans "Wiki" %}
...{{ BASE_API_URL }}ticket/?author__endswith={% trans "test" %}
...{{ BASE_API_URL }}message/?body__contains={% trans "test" %}
{% trans "You can use related fields to filter too. So, you can filter by any field of emailaddress using the 'from_address' field of message, which has a relation to emailaddress. You will achieve the related fields by using double underscore and the field's name. See the example below" %}
...{{ BASE_API_URL }}message/?from_address__real_name__contains=Name
{% trans "So, real_name is a field of emailaddress, and you had access to this field by a message field called from_address and using double underscore to say you want to use a field of that relationship" %}
{% trans "Note: email filters must be exact. Which means that __contains, __startswith, __endswith and others won't work" %}
{% trans "Another example of usage with relations. Used to retrieve all messages of a given user, using the username or the email field" %}
...{{ BASE_API_URL }}message/?from_address__user__username=username
...{{ BASE_API_URL }}message/?from_address__user__email=usermailexample@host.com