Note
You are not reading the most recent version of this documentation. See the latest version available.
REST API¶
REST API allows integrating PACE Packager Hub with the client’s ecosystem. The API allows to remotely interact with the PACE Packager Hub server to get or set the necessary information.
PACE Packager Hub API uses:
standard HTTP methods like GET, PUT, POST
standard HTTP status codes.
JSON communications format in the request body
Access the embed Swagger UI to display OpenAPI document directly
in your PACE Packager Hub server at <host>:<port>/swagger
.
Current API version: v1
List of supported methods:
URI Structure
Structure of PACE Packager Hub REST API:
<host>:<port>/api/<api-version>/<resource>
REMARK: Specify the API version instead of <api-version>
, where
v1
- the specific API version; latest
- a symbolic link to the
latest available version of the API.
Example:
http://pace-packager-hub.local:80/api/v1/projects
Authorization
The PACE Packager Hub API requires authorization via the Bearer token.
Tick Enable API and generate/revoke the token at the Settings > System > API page. For details, see API settings.
REMARK: API methods are run with the Supervisor permissions and have access to all projects of the solution.
Create Order¶
Create a new Order of a specific Order Type in your Project.
Request:
POST /api/v1/ordertype/<OrderTypeId>/order
REMARK: To find out the required Order Type ID of your project, see Get all Order Types.
Request body:
The request body must contain all the attributes, which are defined as Required and has no Default value. To get a list of attributes and their settings, see Get all Attributes.
{
"<attributeId1>": "<value1>",
"<attributeId2>": "<value2>"
}
REMARK: The format of an attribute value (string, int, date) depends on the specific type of that attribute. For details, see Attribute value format.
Example:
POST http://pace-packager-hub/api/v1/ordertype/13/order
{
"Title": "Test Order 1",
"Priority": 6,
"DueDate": "17-05-2022"
}
Attribute value format¶
- Text (single line) attribute type
To set a value:
"<attributeId>": "<string>"
To clear a value:
"<attributeId>": ""
Example:
"Title": "Test Order" "Title": ""
- Text (multiple lines) attribute type
To set a value:
"<attributeId>": "<string1> <string2>"
REMARK: A new row element is defined by
\r\n
To clear a value:
"<attributeId>": ""
Example:
"Description": "Test description text" "Description": ""
- Number attribute type
To set a value:
"<attributeId>": intValue
To clear a value:
"<attributeId>": null
Example:
"No.": 37 "No.": null
- Date attribute type
To set a value:
"<attributeId>": "<dateInFormatDD-MM-YYYY>"
To clear a value:
"<attributeId>": null
Example:
"DueDate": "17-05-2022" "DueDate": null
- Dropdown list (single choice) attribute type
To set a value:
"<attributeId>": <valueId>
REMARK: To find out the list of available values and their ID, see Get all Attributes.
To clear a value:
"<attributeId>": null
Example:
"Complexity": 3 "Complexity": null
- Dropdown list (multiple choice) attribute type
To set a value:
"<attributeId>": [valueId1, valueId2]
REMARK: To find out the list of available values and their ID, see Get all Attributes.
To clear a value:
"<attributeId>": null
Example:
"Technology": [1, 2] "Technology": null
- System user attribute type
To set a value:
"<attributeId>": <userId>
REMARK: To find out the list of available users and their ID, see Get all Users.
To clear a value:
"<attributeId>": null
Example:
"Assignee": 8 "Assignee": null
- Checkbox attribute type
"<attributeId>": <trueOrFalse>
Example:
"Deploy": true "Deploy": false
- URL attribute type
To set a value:
"<attributeId>": "<value>"
To clear a value:
"<attributeId>": ""
Example:
"originalRequest": "https://company.com/tickets/12345" "originalRequest": ""
Get Order Attributes¶
Get a list of Order attributes, their values and settings.
Request:
GET /api/v1/order/<OrderID>/attributes
Or
GET /api/v1/order/<DbRecordID>/attributes
Example:
GET http://pace-packager-hub/api/v1/order/ABC-1/attributes
GET http://pace-packager-hub/api/v1/order/14528/attributes
Edit Order Attributes¶
Set a new values for the Order attributes.
Request:
PUT /api/v1/order/<OrderID>/attributes
Or
PUT /api/v1/order/<RecordID>/attributes
Request body:
The request body must contain attributes that you want to change. To get a list of order attributes with their values and settings, see Get Order Attributes.
{
"<attributeId1>": "<value1>",
"<attributeId2>": "<value2>"
}
The format of an attribute value (string, int, date) depends on the specific type of that attribute. For details, see Attribute value format.
Example:
PUT http://pace-packager-hub/api/v1/order/ABC-1/attributes
{
"Title": "Test Order 1",
"Priority": 6,
"DueDate": "17-05-2022"
}
Edit Order Status¶
Set a new Status for the Order.
Request:
PUT /api/v1/order/<OrderID>/attributes
Or
PUT /api/v1/order/<RecordID>/attributes
Request body:
The request body must contain the "Status"
attribute with an ID of the
required Status. To get a list of available order statuses, see
Get all Statuses.
{
"Status": <statusId>
}
Example:
PUT http://pace-packager-hub/api/v1/order/ABC-1/attributes
{
"Status": 1014
}
Get all Orders¶
Get a list of Orders of your project.
Request:
GET /api/v1/project/<ProjectId>/orders
Example:
GET http://pace-packager-hub/api/v1/project/32/orders
Get all Projects¶
Get a list of the existing Projects, their general information and list of assigned Users.
Request:
GET /api/v1/projects
Example:
GET http://pace-packager-hub/api/v1/projects
Get all Users¶
Get a list of the registered Users of the system.
Request:
GET /api/v1/users
Example:
GET http://pace-packager-hub/api/v1/users
Get all Order Types¶
Get a list of available Order Types of the specific Project.
Request:
GET /api/v1/project/<ProjectId>/ordertypes
REMARK: To find out the required Project ID, see Get all Projects.
Example:
GET http://pace-packager-hub/api/v1/project/1131/ordertypes
Get all Statuses¶
Get a list of available Statuses for the specific Order Type.
Request:
GET /api/v1/ordertype/<OrderTypeId>/statuses
REMARK: To find out an Order Type ID of your existing Order,
make the Get Order Attributes request and look for the
"orderType"
section in the response. To find out an ID of the specific
Order Type of the specific Project, see
Get all Order Types.
Example:
GET http://pace-packager-hub/api/v1/ordertype/27/statuses
Get all Attributes¶
Get a list of all Attributes, their settings and values for the specific Order Type.
Request:
GET /api/v1/ordertype/<OrderTypeId>/attributes
REMARK: To find out an Order Type ID of your existing Order,
make the Get Order Attributes request and look for the
"orderType"
section in the response. To find out an ID of the specific
Order Type of the specific Project, see
Get all Order Types.
Example:
GET http://pace-packager-hub/api/v1/ordertype/27/attributes