5.3 Working With Policies Via API
URI: https://myIsoraURL/api/policies
Verb | Address | Notes | Details |
---|---|---|---|
GET | /policies?page=X &page_size=Y | Returns a paginated list of all question policies. Default number of policies per page is 25. | The beginning of each response includes a count and a link to the next page. Each entry in the list has a link to itself. Use page and page_size values if desired. |
GET | /policies?search=string &page=X &page_size=Y | Returns a paginated list of all policies containing the search criteria. | string refers to the search string. All fields are searched. |
GET | /policies/<policy id> | Returns object representing the policy with a given id |
|
POST | /policies | Creates a new policy object; optionally link it to a list of existing questions (specified by their object ids) | { “framework”:“string”, ”section”:”string”, “questions”: [array of question id strings]* } *Questions are optional. Question ids can be obtained by using the GET command on the /questions endpoint to retrieve a list of all questions and their ids. Format the array as follows: [ “ID1”, “ID2”, … “IDN” ] |
PUT | /policies/<policy id> | Replaces an existing policy with an entirely new one | ex: { “framework” : “string”, “section” : “string”, “questions” : [array of question strings],* “change_log” : “string”** } *Format the array as follows: [ “ID1”, “ID2”, … “IDN” ] **This refers to a changelog entry for the policy itself. Any affected questions will show “Policy updated” as their changelog entries. |
PATCH | /policies/<policy id> | Replaces certain details of an existing policy | ex: { “framework” : ”string”, “section” : “new section name”, “change_log” : “string” } Note: The framework and section are both required for the PATCH command (even though they probably shouldn’t be). |
DELETE | /policies/<policy id> | Deletes the specified policy |
|