Libraries

Request Libraries

Performing a GET command returns the library objects for the specified account.

Table 1. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries The GET method submits the accountId and returns all associated libraries.
Table 2. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries

Replace {accountId} with the value of the actual accountId.

Example /DGSCoreManagement/api/rest/library/accounts/1/libraries
Table 3. Responses
Code Description
200 Successful response
Example:
[
    {
        "id": "32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8",
        "status": "Deployed",
        "prefix": "1.Deposit.1.",
        "libraryName": "Deposit",
        "version": 1,
        "isDefault": false,
        "ownerAccount": 1,
        "copyToChildOrgsPkg": false,
        "notes": ""
    },
    {
        "id": "ee6e8eba-4508-4eb0-862e-a6cd009d7916",
        "status": "Deployed",
        "prefix": "1.TxnStatic1129.1129.",
        "libraryName": "TxnStatic1129",
        "version": 1129,
        "isDefault": false,
        "ownerAccount": 1,
        "copyToChildOrgsPkg": false,
        "notes": ""
    },
    {
        "id": "b2d9f3ea-e6c5-4746-b712-a6d500d4858e",
        "status": "Deployed",
        "prefix": "1.FillableCheckbox.1206.",
        "libraryName": "FillableCheckbox",
        "version": 1206,
        "isDefault": false,
        "ownerAccount": 1,
        "copyToChildOrgsPkg": false,
        "notes": ""
    }
]
401 Not Authorized
404 Libraries not found
500 Unexpected error

Create a Library

Performing a POST command creates a library object for the specified account.

Table 4. Method
Method URL Description
POST /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries The POST method submits the data from the body and returns the new library information (see example response).
Table 5. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries

Replace {accountId} with the value of the actual accountId.

body string required

librayName: a string value identifying the name of the library

version: an integer value indicating the version of the library

isDefault: a boolean value (true|false) indicating if the new library is to be the default library

ownerAccount: an integer value indicating the accountId to associate the new library

copyToChildOrgsPkg: a boolean value indicating if the library should be copied to the child orgs package

notes: a string value containing any notes to associate with the new library

Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries
body:
{
  "libraryName": "Deposit",
  "version": 1,
  "isDefault": true,
  "ownerAccount": 1,
  "copyToChildOrgsPkg": true,
  "notes": "Main library for Deposit records"
}
Table 6. Responses
Code Description
201 Successful response
Example:
{
    "id": "795c21d0-be0e-4cb7-8b74-4f1cb4412154",
    "status": "Created",
    "prefix": "1.Deposit.1",
    "libraryName": "Deposit",
    "version": 1,
    "isDefault": true,
    "ownerAccount": 1,
    "copyToChildOrgsPkg": true,
    "notes": "Main library for Deposit records"
}
401 Not Authorized
404 Invalid URL
500 Unexpected error

Request Library Information

Performing a GET command returns information for the specified library.

Table 7. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId} The GET method submits the libraryId and returns the associated library information.
Table 8. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}
Example /DGSCoreManagement/api/rest/library/accounts/1/libraries/32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8
Table 9. Responses
Code Description
200 Successful response
Example:
{
    "id": "32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8",
    "status": "Deployed",
    "prefix": "1.Deposit.1.",
    "libraryName": "Deposit",
    "version": 1,
    "isDefault": false,
    "ownerAccount": 1,
    "copyToChildOrgsPkg": false,
    "notes": ""
}
401 Not Authorized
404 Library not found
500 Unexpected error

Update Library Information

Performing a PATCH command updates information for the specified library.

Table 10. Method
Method URL Description
PATCH /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId} The PATCH method submits the libraryId with the body content and returns the associated library information.
Note: Currently only the status parameter is available to update.
Table 11. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}
body string required

status: a string indicating the desired status for the library

Options include:
  • Deployed
  • QueuedForUndeployment
Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/795c21d0-be0e-4cb7-8b74-4f1cb4412154
body:
{
  "status": "QueuedForDeployment"
}
Table 12. Responses
Code Description
202 Successful response
Example response:
{
    "id": "795c21d0-be0e-4cb7-8b74-4f1cb4412154",
    "status": "QueuedForUndeployment",
    "prefix": "1.Deposit",
    "libraryName": "Deposit",
    "version": 1,
    "isDefault": true,
    "ownerAccount": 1,
    "copyToChildOrgsPkg": true,
    "notes": "Main library for Deposit records"
}
401 Not Authorized
404 Library not found
500 Unexpected error

Upload a Library

Performing a POST command uploads a library to the specified accountId.

Table 13. Method
Method URL Description
POST /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/upload The POST method submits the body content to the specified account.
Table 14. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/upload
body string required
{
  "id": "string",
  "status": "string",
  "prefix": "string",
  "libraryName": "string",
  "version": 0,
  "isDefault": true,
  "ownerAccount": 0,
  "copyToChildOrgsPkg": true,
  "notes": "string"
}
Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8
body:
{
  "id": "DAE7CDD6-1729-4D69-B5DF-A97D01153D97",
  "status": "QueuedForDeployment",
  "prefix": "1.Library.1.",
  "libraryName": "DepositLibrary",
  "version": 1,
  "isDefault": true,
  "ownerAccount": 1,
  "copyToChildOrgsPkg": true,
  "notes": "Main library for Deposit"
}
Table 15. Responses
Code Description
202 Successful response
400 Bad Request
401 Not Authorized
404 Library not found
500 Unexpected error

Delete a Library

The DELETE command allows you to delete an existing library within a specified account.

Table 16. Method
Method URL Description
DELETE /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId} The DELETE method deletes the specified library object.
Note: A library can be deleted only if its status is Undeployed.
Table 17. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}
Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8
Table 18. Responses
Code Description
204 Successful response
401 Not Authorized
404 Library not found
500 Unexpected error

Request Allowed Accounts for a Library

The GET method allows you to retrieve the allowed accounts for a specified library.

Table 19. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts The GET method returns the allowed accounts for a specified library object.
Table 20. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts
Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/allowedAccounts
Table 21. Responses
Code Description
200 Successful response
Example:
[
    1,
    8,
    5384,
    6010,
    6011,
    68,
    11
]
401 Not Authorized
404 Library not found
500 Unexpected error

Add Allowed Account to a Library

The POST method allows you to add a new account to the specified library.

Table 22. Method
Method URL Description
POST /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts The POST method submits the library array from the body.
Table 23. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts
body string required
[
  0
]

Multiple accounts can be associated simultaneously.

Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/b2d9f3ea-e6c5-4746-b712-a6d500d4858e/allowedAccounts
body:
[
  2112,
  2113,
  2114
]
Table 24. Responses
Code Description
200 Successful response
Example response:
[
    1,
    11,
    68,
    2112,
    2113,
    2114,
    5384,
    20001
]
401 Not Authorized
404 Library not found
500 Unexpected error

Delete Account from a Library

The DELETE method allows you delete allowed accounts from a specified library.

Table 25. Method
Method URL Description
DELETE /DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts The DELETE command deletes one or more allowed accounts from the specified library and then returns a list of all allowed accounts.
Table 26. Parameters
Name Type Constraints Description
url string required
/DGSCoreManagement/api/rest/library/accounts/{accountId}/libraries/{libraryId}/allowedAccounts
body string required
[
  0
]
Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/libraries/32f95a3a-af1d-4ab8-81c0-a6be00b4a4f8/allowedAccounts
body:
[
  4,
  5,
  6
]
Table 27. Responses
Code Description
202 Successful response
Example response:
[
  1,
  2,
  3,
  7,
  8
]
401 Not Authorized
404 Library not found
500 Unexpected error