16.1.1.6. Service ID endpoints¶
The serviceid endpoint allows administrators to manage service ID definitions.
- GET /serviceid/(name)¶
- GET /serviceid/¶
This call returns the information for the given service ID. If no name is specified, it returns a list of all defined services.
- Return
a json result with a list of services
Example request:
GET /serviceid/ HTTP/1.1 Host: example.com Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": { "service1": {"description": "1st service"}, "service2": {"description": "2nd service"} } } }, "version": "privacyIDEA unknown" }
- POST /serviceid/(name)¶
This call creates a new service ID definition or updates the description of an existing service ID.
Note, that the identifier (name) of the service ID needs to be unique.
- Parameters
name – The unique name of the service ID
description – The description of the service ID definition
- Return
Example request:
To create a new serviceid “serviceA” with a description call:
POST /serviceid/serviceA HTTP/1.1 Host: example.com Accept: application/json Content-Length: 26 Content-Type: application/x-www-form-urlencoded description=My cool first service
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": 1 } "version": "privacyIDEA unknown" }
- DELETE /serviceid/(name)¶
This call deletes the given service ID definition.
- Parameters
name – The name of the service.
- Return
a json result with value=1 if deleting the service ID was successful
Example request:
DELETE /serviceid/service1 HTTP/1.1 Host: example.com Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "jsonrpc": "2.0", "result": { "status": true, "value": 1 }, "version": "privacyIDEA unknown" }