Search for lockers using filters

This example shows how to use this URL to return a list of lockers where the user has owner permission.

Prerequisites

Note:
  • Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at http://<your_control_room_url>/swagger/.
  • You can also use a REST client to complete this task.

Procedure

  1. Add an authentication token to the request header.
    Note: Use the Enterprise 11 Authentication API to generate a JSON Web Token.
  2. Specify the method and URL.
    • Method: POST
    • URL: http://<your_control_room_url>/v2/credentialvault/lockers/list
  3. Add filter parameters in the request body to return only the lockers where the user is an owner.
    Request body:
    {
      "sort":[],
      "filter":{
        "value":"permissions",
        "field":"owner"
        },
      "fields":[],
      "page":{ }
    }
  4. Send the request.
    • In a REST Client, click SEND.
    • In the Swagger interface, click Execute.

    Response body: The response for this example returns information on two lockers.

    {
      "page": {
        "offset": 0,
        "total": 2,
        "totalFilter": 2
      },
      "list": [
        {
          "id": "2",
          "name": "connection param",
          "description": "",
          "createdBy": "14",
          "createdOn": "2019-12-19T21:37:28.253Z",
          "updatedBy": "14",
          "updatedOn": "2020-02-03T19:35:37.419Z",
          "version": "3",
          "members": [
            {
              "id": "4",
              "permissions": [
                "participate"
              ]
            },
            {
              "id": "14",
              "permissions": [
                "participate",
                "own",
                "manage"
              ]
            }
          ],
          "countOfCredentials": 2
        },
        {
          "id": "4",
          "name": "AccountsNew",
          "description": "",
          "createdBy": "14",
          "createdOn": "2020-02-03T18:25:52.079Z",
          "updatedBy": "14",
          "updatedOn": "2020-02-21T20:46:59.045Z",
          "version": "2",
          "members": [
            {
              "id": "14",
              "permissions": [
                "participate",
                "own",
                "manage"
              ]
            }
          ],
          "countOfCredentials": 0
        }
      ]
    }
Note: You can also run REST requests from a command terminal. The following is a curl request example. This example is formatted for readability. Replace the text inside the angle brackets, <authentication_token>, with your authentication token.
curl -X POST "<your_control_room_url>/v2/credentialvault/lockers/list" -H "accept: application/json"
        -H "X-Authorization: <authentication_token>" -H "Content-Type: application/json"
        -d "{    
            \"fields\": [],
            \"filter\": {
                \"field\": \"permissions\",
                \"value\": \"owner\" 
	      },
            \"sort\": [],
            \"page\": {}
            }"