Returns a list of resources of a specific type in a folder.
GET <NG2_URL>/restapi/v1/resourceFolder/<type>/**?start=5&length=100
Replace ** with the path and name of the resource folder.
Input:
<type>: The resource type, for instance “template”.
start: Optional index of the first resource to return (default is 0).
length: Optional maximum number of resources to return (default is all).
JSON example output:
{
"total": 1,
"resources": [
{
"metaData": {
"SIZE": 127749,
"LAST_MODIFIED": 1743172227094,
"PROVIDER": "FILE",
"READ_ONLY": false,
"ORIGINAL_PATH": "C:\\ProgramData\\InterFormNG2\\resources\\home\\template\\ASTRO\\PREADVICE_PDFUA.ift",
"LAST_USED": 1746019879810
},
"name": "PREADVICE_PDFUA.ift",
"path": "/ASTRO/PREADVICE_PDFUA.ift",
"directory": false,
"fileType": "FILE"
}
]
}
Creates a folder in the library of a specific resource type.
POST <NG2_URL>/restapi/v1/resourceFolder/<type>/**
Replace ** with the path of the parent folder.
Input:
<type>: The resource type, for instance “template”.
The body of the request must be a JSON object with the name of the folder to create
Example JSON input:
{
"folderName": "created from api"
}
Typical HTTP error codes:
400: Folder name missing from request body.
422: Parent resource if not a folder.
404: The parent folder does not exist.
Returns the binary content of a resource.
GET <NG2_URL>/restapi/v1/resource/<type>/**
Replace ** with the path and name of the resource.
Input:
<type>: The resource type, for instance “template”.
Typical HTTP error codes:
404: The resource does not exist.
Uploads a file and either creates a new resource or replaces the content of an existing resource.
Note that for versioned resources where the approval process is enabled, existing resources will only be checked out. /restapi/v1/resourceApproval/
can be used afterwards to create an approval task.
POST <NG2_URL>/restapi/v1/resource/<type>/**?checkoutOnly=true&versionDescription="change description"
Replace ** with the destination path of the resource.
Input:
<type>: The resource type, for instance “template”.
checkoutOnly: Optional, only relevant for versioned resources. Set this to true if the existing resource should only be checked out. If this is false, a new version is immediately published.
versionDescription: Optional, only relevant when checkoutOnly=true. The description of the changes in this version.
JSON example output (output if the resource was checked out):
{
"checkedOut": true
}
Typical HTTP error codes:
409: The resource is locked due to a previous change pending approval.
Deletes a resource.
DELETE <NG2_URL>/restapi/v1/resource/<type>/**
Replace ** with the path and name of the resource.
Input:
<type>: The resource type, for instance “template”.
Typical HTTP error codes:
409: The resource is locked due to a previous change pending approval.
Moves or renames an existing resource.
PATCH <NG2_URL>/restapi/v1/resource/<type>/**
Replace ** with the path and name of the resource to move/rename.
Input:
<type>: The resource type, for instance “template”.
The body of the request must be a JSON object with the destination path and name.
Example JSON input:
{
"destinationPath": "ASTRO/moveme.ift"
}
Typical HTTP error codes:
400: Destination path missing from request body.
404: The resource does not exist.
400: Missing destination path.
Creates an approval task for a resource or a set of dependent resources. For instance when requesting approval for a template, it can make sense to also include any modified translations or images that are used by the template.
POST <NG2_URL>/restapi/v1/resourceApproval/<type>/**
Replace ** with the path and name of the primary resource to request approval for.
Input:
<type>: The resource type, for instance “template”.
The body of the request must be a JSON object with additional information about the approval request.
Description: The description of the changes.
approvalWorkflowId: The ID of the workflow that should be used for the approval process.
major: True if the change should result in a new major version.
additionalResources: Type and path of all modified resources that are related to the primary resource.
Example JSON input:
{
"description": "Changed header design",
"approvalWorkflowId": "Final",
"major": false,
"additionalResources": {
"resource" : [
{
"resourceType": "translation",
"path": "std/translations.properties"
}
]
}
}
Typical HTTP error codes:
409: The resource is locked due to a previous change pending approval.
422: Versioning-related error, typically that the resource is checked out by another user or the approval workflow ID is incorrect.