Get custom libraries API

You can use this API to get all the custom libraries.

HTTP method and URI path

GET /v4/libraries

Standard headers

Use the following standard HTTP header with this request:

Content-Type: application/json

Authorization: <Bearer token>

Required authorizations

The user ID associated with the token which is specified in the request header needs to be granted with one of the following roles:

  • sysadm
  • mladm
  • apiuser
  • devuser

Expected response

On completion, the service returns an HTTP response, which includes a status code that indicates whether your request is completed. Status code 200 indicates a successful completion. A status code of 4nn or 5nn indicates an error.

The response includes metadata and should be an array for the libraries output, each element of the libraries output is returned as described in Table 1.
Table 1. Response from a successful request

In this table, the Field column and Subfield columns list the returned fields, and the Description column provides a brief description of the field.

Field Subfield Description
first href The href prefix of the custom library. Example: /v4/libraries.
id This is a custom library API.
limit The max number of libraries to show in the response. Default is 100.
resources An array of libraries. For each element of the libraries output, see the response of the Get custom library API.
Response example of a successful request:
{
    "first": {
        "href": "/v4/libraries",
        "id": "libraries"
    },
    "limit": 100,
    "resources": [
        {
            "entity": {
                "command": "",
                "description": "",
                "filename": "com.ibm.db2__db2jcc4__11.5.jar",
                "name": "eeee",
                "platform": {
                    "name": "spark",
                    "versions": [
                        "4.0”
                    ]
                },
                "space": {
                    "href": "/v4/spaces/017cbc6c-7a49-4c44-956c-8a0c26a3f76d",
                    "id": "017cbc6c-7a49-4c44-956c-8a0c26a3f76d"
                },
                "tags": [],
                "version": "4.0"
            },
            "metadata": {
                "created_at": "2022-11-06T09:11:52.351Z",
                "guid": "e362b6f4-6b00-481b-b76c-a6393f7e4aa0",
                "href": "/v4/libraries/e362b6f4-6b00-481b-b76c-a6393f7e4aa0",
                "id": "e362b6f4-6b00-481b-b76c-a6393f7e4aa0",
                "modified_at": "2022-11-06T09:41:06.907Z",
                "owner": "wmlz01"
            }
        },
        {
            "entity": {
                "description": "this is a test library",
                "name": "mylibrary_jar0429-3",
     "platform": {
                    "name": "spark",
                    "versions": [
                        "4.0”
                    ]
                },    
                "space": {
                    "href": "/v4/spaces/017cbc6c-7a49-4c44-956c-8a0c26a3f76d",
                    "id": "017cbc6c-7a49-4c44-956c-8a0c26a3f76d"
                },
                "tags": [
                    {
                        "description": "test_desc_json",
                        "value": "test_value_json"
                    }
                ],
                "version": "4.0"
            },
            "metadata": {
                "created_at": "2022-11-10T06:42:16.919Z",
                "guid": "675c08f7-7e78-4509-b628-daf978efb605",
                "href": "/v4/libraries/675c08f7-7e78-4509-b628-daf978efb605",
                "id": "675c08f7-7e78-4509-b628-daf978efb605",
                "modified_at": "2022-11-10T06:42:16.919Z",
                "owner": "admin"
            }
        }
    ]
}