API Examples in CURL data format.
Because you can add the APIKey to the request header and avoid explicit login, it
makes all interactions simpler. The examples in this article use an APIKey
obtained through the Manage API Keys interface, on the
host:port/arc/apps/apikeys
browser page of the ArcViz installation (see Creating New API Keys). The actual APIKey and the
method of retrieving the key depends on the user system.
See Example 1 to learn how to get all roles information, and Example 2 to change the description of a role.
To use CURL to obtain a full dump of all roles, use the following command.
Note that the output is piped to the standard python JSON dumper for easier reading; it is not necessary for CURL access.
curl -s \
-X GET \
-H "Authorization: apikey ApiKey" \
api_url/roles?detail=1> | python -m json.tool
Note that the login URL has the form
[http|https]:/host:port/arc/apps/login
.
For syntax of other parameters, see Admin API Syntax Parameters.
To change the description for role ID 3, use the following command.
For CURL to supply data through the POST method, use the
application/x-www-form-urlencoded
content
type.
curl -s \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: apikey ApiKey" \
-d 'data=[{"desc":"Updated description again"}]' \
api_url/roles/3
For the definition of fields for each data type, see Data Type Details. For syntax of other parameters, see Admin API Syntax Parameters.