Get custom library API

You can use this API to get the information of the specified library.

HTTP method and URI path

GET /v4/libraries/{library_id}

Where:

library_id (required) is the ID of the library to be filtered from the library list.

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 201 indicates a successful completion. A status code of 4nn or 5nn indicates an error.

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
Entity name The name of the library.
platform The platform that the library runs on.
  • name: Required for string. The name of the platform that the package runs on.
  • versions: Required for string. The version of the platform.
version The library version.
description The description of the library.
filename The name of the uploaded package file. For example, ltestlgnorm.jar.
space Internal library space. It can’t be changed in system. We use a static space ID.
  • href: The href of the space that the library stored in.
  • id: The ID of the space.
tags An array of tags for the library. Each tag includes following two fields.
  • value: Required for String. The text of the tag.
  • description: Optional for String. Description of the tag.
metadata guid The unique ID of the library.
id The unique ID of the library. Same as guid.
href The URI of the library.
owner The ID of the user that created this library.
created_at The creation timestamp of the library.
modified_at The timestamp of the last modification of the library.
Response example of a successful request:
{
    "entity": {
        "command": "",
       "custom": {},
        "description": "",
        "filename": "com.ibm.db2__db2jcc4__11.5.jar",
        "model_definition": false,
        "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"
    }
}