CURL Data Format and APIKey examples

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 on the .../arc/apps/apikey page. 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.

Example 1: Getting all roles

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" \
 127.0.0.1:7999/arc/adminapi/v1/roles?detail=1 | python -m json.tool

Example 2: Changing the role description

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"}]' \
 127.0.0.1:7999/arc/adminapi/v1/roles/3

For the definition of fields for each data type, see Data Type Details.