Action Pending Approvals

For the actions on pending approvals, such as approve and reject, use the following URIs:
  • /requests GET: Retrieves the pending approvals for the user

  • /requests PUT: Updates the pending approval

  • /requests DELETE: Revokes or withdraws a request

cURL Example for Retrieving Pending Approvals

curl  -H "Content-Type: application/json"  -X GET  -u username:password  https://pseudo.com/iam/governance/selfservice/api/v1/requests?view=pendingApprovals

GET Response Body

{
    "links": [
        {
            "rel": "self",
            "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests?view=pendingApprovals&offset=1&limit=10"
        },
        {
            "rel": "first",
            "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests?view=pendingApprovals&offset=1&limit=10"
        }
    ],
    "count": 4,
    "hasMore": false,
    "totalResult": -1,
    "requests": [
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/1009"
                }
            ],
            "title": "Default request level approval for Request ID 1009",
            "id": "1009",
            "creator": "aarora",
            "taskId": "a8d8ba9e-3787-4510-af9a-c21b8947b247",
            "state": "ASSIGNED",
            "status": "Request Awaiting Approval",
            "assignee": "SYSTEM ADMINISTRATORS",
            "created": "2019-06-20T20:34:08Z"
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/1012"
                }
            ],
            "title": "Default operational level approval for Request ID 1012",
            "id": "1012",
            "creator": "aarora",
            "taskId": "ae5de640-6f8f-4140-b89d-8cc90041a6e3",
            "state": "ASSIGNED",
            "status": "Request Awaiting Approval",
            "assignee": "SYSTEM ADMINISTRATORS",
            "created": "2019-06-21T17:40:14Z"
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/2006"
                }
            ],
            "title": "Default operational level approval for Request ID 2006",
            "id": "2006",
            "creator": "dtran20190701",
            "taskId": "fb5c4722-9f5a-49c0-9edf-1cf4b171a5f6",
            "state": "ASSIGNED",
            "status": "Request Awaiting Approval",
            "assignee": "SYSTEM ADMINISTRATORS",
            "created": "2019-07-01T18:01:52Z"
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/2007"
                }
            ],
            "title": "Default operational level approval for Request ID 2007",
            "id": "2007",
            "creator": "dtran20190701",
            "taskId": "780115f1-2184-497f-8189-b4f921be7865",
            "state": "ASSIGNED",
            "status": "Request Awaiting Approval",
            "assignee": "SYSTEM ADMINISTRATORS",
            "created": "2019-07-01T18:08:25Z"
        }
    ]
}

cURL Example for Approving a Pending Request

curl  -H "Content-Type: application/json"  -H "X-Requested-By: <anyvalue>"  -X PUT  -u username:password  -d @put.json https://pseudo.com/iam/governance/selfservice/api/v1/requests/2006

PUT Request Body

{
    "requestId": "coder-1001",
    "action": "approve"
}

PUT Response Body

{
    "links": [
        {
            "rel": "self",
            "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/2006"
        }
    ],
    "id": "2006",
    "requestId": "coder-1001",
    "status": "SUCCESS"
}

cURL Example for Withdrawing a Request

curl  -H "Content-Type: application/json"  -H "X-Requested-By: <anyvalue>"  -X  DELETE  -u  username:password  -d  @post.json https://pseudo.com/iam/governance/selfservice/api/v1/requests/2007

DELETE Response Body

{
    "links": [
        {
            "rel": "self",
            "href": "https://pseudo.com/iam/governance/selfservice/api/v1/requests/2007"
        }
    ],
    "id": "2007",
    "status": "withdrawn"
}