Skip to main content

ACL-OKM API

The ACL-OKM API manages the relationships between ACLs and OKMs. The function of the resource is simple: it attaches an ACL to a specific OKM.

In order to be available for key checkout, an ACL must be associated with the OKM with which the key checkout occurs. Implementers can create multiple ACLs and associate them with as many OKMs as required.

The combination of ACL and OKM must be unique. That is, you cannot assign an ACL to the same OKM more than once, and you can only assign one ACL for a user to one OKM.

GET​

Get all relationships for one customer​

Sending a GET to the acl-okms endpoint will return a list of the ACL and OKM relationships for a customer. The default pagination is 30 records per request.

To modify pagination, use these query parameters in your request:

  • page: Set the page number (default is 1).
  • results_per_page: Set how many records to fetch per request.

Example request:

GET api/v1/acl-okms?customer=:customer

Example response:

{
"message": "Resource fetched successfully",
"pagination": {
"page": 1,
"results_per_page": "30",
"total_results": "6"
},
"data": [
{
"acl_id": "acl1_cust1234",
"okm_id": "okm1_cust1234"
},
{
"acl_id": "acl1_cust1234",
"okm_id": "okm2_cust1234"
},
{
"acl_id": "acl1_cust1234",
"okm_id": "okm3_cust1234"
},
...
]
}

Get a list for the customer with pagination​

The default pagination is 30 records per request.

GET api/v1/acl-okms/?customer=:customer&page=:startPage&results_per_page=:resultsPerPage

Example response will be the same as above

Get one list for a customer​

Sending a GET to the acl-okm endpoint with an id will return an acl-okm relationship object for a customer. The default pagination is 30 records per request.

Example request:

GET api/v1/acl-okms/:aclOkmId?customer=:customer

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"message": "Resource fetched successfully",
"data": {
"acl_id": "acl1_cust1234",
"okm_id": "okm1_cust1234"
}
}

Possible errors​

Error CodeDescription
400 Bad request
403 Forbidden{ "error_code": "UNAUTHORIZED_ACCESS", "error_msg": "Missing required scopes" }
404 Not FoundError: acl-okm record not found

Context requirement (access right)​

The following context must be present in the JWT access token “context” object:

"context": {
"service-okm": {
"acl-okms": ["read"]
}
}

POST​

Sending a POST to the acl-okms endpoint will link an ACL to an OKM.

POST api/v1/acl-okms/

Example request:

{
"customer": "invu",
"acl_id":"acl1_cust1234",
"okm_id":"okm1_cust1234"
}

Where:

FieldTypeDescription
customerstringThe customer name.
acl_idstringId of the ACL to link to the OKM identified by okm_id.
okm_idstringId of the OKM to link the ACL to.

Example response:

HTTP/1.1 201 OK
{
"message": "Resource created successfully"
}

Possible errors​

Error codeDescription
400 Bad RequestEror: Error in creating acl-okm record error: duplicate key value violates unique constraint "acl_id_customer_key"
403 Forbidden{ "error_code": "UNAUTHORIZED_ACCESS", "error_msg": "Missing required scopes" }

Context requirement (access right)​

The following context must be present in the JWT access token “context” object:

"context": {
"service-okm": {
"acl-okms": ["create"]
}
}

PUT​

Sending a PUT to the acl-okms endpoint will update the link between an ACL and an OKM.

PUT api/v1/acl-okms/

Example request:

{
"customer": "invu",
"acl_id":"acl2_cust1234",
"okm_id":"okm4_cust1234"
}

Where the customer, acl_id, and okm_id follow the same definition of the POST section.

Example response:

HTTP/1.1 200 OK

Possible errors​

Error codeDescription
400 Bad RequestOKM id is missing. ACL id is missing. Body is empty.
403 Forbidden{ "error_code": "UNAUTHORIZED_ACCESS", "error_msg": "Missing required scopes" }
404 Not FoundACL is not found. OKM is not found.

Context requirement (access right)​

The following context must be present in the JWT access token “context” object:

"context": {
"service-okm": {
"acl-okms": ["update"]
}
}

DELETE​

A DELETE request sent to the acl-okms endpoint removes the link between an ACL and an OKM. DELETE api/v1/acl-okms/:okmId?customer=:customer

Example response:

html HTTP/1.1 200 OK

Possible errors​

Error codeDescription
400 Bad RequestOKM id is missing.
403 Forbidden{ "error_code": "UNAUTHORIZED_ACCESS", "error_msg": "Missing required scopes" }
404 Not FoundOKM not found

Context requirement (access right)​

The following context must be present in the JWT access token “context” object:

"context": {
"service-okm": {
"acl-okms": ["delete"]
}
}

PATCH​

Not supported.

Error codeDescription
405 Method Not AllowedCannot PATCH