{% extends 'layout.html' %} {% set page_title = 'API Help' %} {% block body %}
Welcome to the Solace API. Currently this API is limited to read-only access to Solace.
The Solace API is accessed via HTTP on the API URL (the URL of the page
you're looking at right now). The method you want to access is then
appended to the URL. For example to use the get_user
method you would open a connection to the following URL:
{{ request.url }}users/username
The format of the data returned can be one of the following:
The format is selected based on the Accept
HTTP header or
can be provided as URL parameter:
{{ request.url }}badges/?format=xml
The language of the response is selected from the Accept-Language
header or the lang
URL parameter:
{{ request.url }}badges/?lang=de
It is strongly recommended to use the HTTP headers instead of the URL parameters. The headers allow you to provide multiple values and let the server pick the ones that are available.
For debugging you can use your web browser and open the URL with it. The default headers of a web browser will return the response in debug HTML format which shows you the data right in your browser in a human readable fashion.
The API follows REST semantics as closely as possible without causing too much troubles for server and client. Make sure to follow the following rules:
If you don't want (or can) use the JSON format which is strongly recommended you can also use our XML representation of the data.
The following rules apply for the XML format:
All elements returned from the API belong to the
{{ xmlns }}
XML namespace.
If an object in JSON has a #type
key and the value
starts with solace.
the value after solace.
is used as tag:
{'#type': 'solace.foo', 'bar': 'bar'}
becomes in XML
{{ ''|e }} baz
Otherwise the object is returned as dict and the type is stored as attribute:
{'foo': 'bar', '#type': 'special'}
becomes in XML
{{ ''|e }} bar
If no #type
key exists that attribute is missing.
List items are wrapped in a list
tag:
[1, 2, {'foo': 'bar'}]
becomes in XML
{{ ''|e }}
- 1
- 2
bar
The following API methods exist: