Skip to main content

getPoliciesList

This method retrieves the list of available policies.

Parameters

Parameter

Type

Optional

Description

page

Number

Yes

The page of results. The default value is 1.

perPage

Number

Yes

The number of items displayed in a page. The upper limit is 100 items per page. Default value: 30 items per page.

Return value

This method returns an Object containing a list of policy objects. The result has the following structure:

  • page - the current displayed page

  • pagesCount - the total number of available pages

  • perPage - the total number of returned items per page

  • total - the total number of items

  • items - the list of policies. Each entry in the list has the following fields:

    • id, the ID of the policy,

    • name, the name of the policy,

    • companyId, the ID of the company which owns the policy,

    • companyName, the name of the company which owns the policy

Example

Request:

  {
       "params": {
           "companyId": "55896b87b7894d0f367b23c6",
           "page": 1,
           "perPage": 2
       },
       "jsonrpc": "2.0",
       "method": "getPoliciesList",
       "id": "5399c9b5-0b46-45e4-81aa-889952433d86"
  }  

Response:

  {
      "id":"5399c9b5-0b46-45e4-81aa-889952433d86",
      "jsonrpc":"2.0",
      "result": {
           page: 1,
           pagesCount: 2,
           perPage: 2,
           total: 4
           items[
               {
                   "id" : "21a295eeb1a43d8b497b23b7",
                   "name" : "Policy 1",
                   "companyId" : "55896b87b7894d0f367b23c6",
                   "companyName" : "Company Test"
               },
               {
                   "id" : "23a295d8b1a43d7c4a7b23c9",
                   "name" : "Policy 2",
                   "companyId" : "55896b87b7894d0f367b23c6",
                   "companyName" : "Company Test"
               }
           ]
       }
  }