API
- 1 Authorization
- 2 Using the Web API with API key
- 3 Endpoints
- 3.1 Definition
- 3.2 Approval
- 3.2.1 List approvals
- 3.2.2 Create approval
- 3.2.3 Delete approval
We expose some parts of Approval Path functionality by API.
Authorization
You have to generate an API key in our app.
It is available in the Approval Path global view.
Click Apps in the top > Approval Path for Confluence
> API Keys
> Create a new API Key
Setup your API key and copy or download it. The template has the following fields:
Key name - provide your name for the API key, up to 40 characters long.
Key value - non-modifiable field, shows the value of the key.
Reveal - reveals the key. This is NOT one time operation - you can reveal the key at any time.
Download - downloads the key to the selected location.
Get page approval status - determines whether list approval for page operation is allowed for the key.
List approval definitions - determines whether list approval definition operation is allowed for the key.
Create approval for page - determines whether create operation is allowed for the key.
Delete approval - determines whether delete operation is allowed for the key.
Allow change performer origin - presents a valuable customization capability for users, empowering them to personalize change performer. Once checked, users are granted the flexibility to adjust performer origin according to their chosen parameters.
Change Performer Origin select offers three distinct options:
User - to ensure smooth operations, it is essential to select a valid user as the new performer. This can be done by utilizing the option that allows the selection of a specific user.
Page creator - you to set user who created the page as the new change performer. In cases where the field does not have a valid user, you have the option to assign a default page creator to ensure continuity.
Â
Â
Page modifier - you can set user who last modified the page as the new change performer. In instances where the field lacks a valid user, you retain the option to select a default page modifier, ensuring a smooth transition in the performer's origin.
Â
Â
User from API call - API call body parameter allows for the passing of a user id. User ids can be limited to users from a designated group. In cases where the submitted user id is empty or does not contain a valid user, a default user can be selected. However, if the submitted user does not belong to the specified group, an error will be returned.
Â
Â
Not valid before - set the start date for key validity.
Not valid after - set the invalidation date for the key.
Allowed IPs - set IPs or IP range that can use the key.
Description - description of the key. Maximum 4000 characters.
Creation time - non-modifiable field, the time when the key was created.
Last modified - non-modifiable field, the time when the key was last modified.
Last usage - non-modifiable field, the time when the key was last used.
Usage Count - non-modifiable field, counter that shows how many times the key was used.
Using the Web API with API key
With key generated, you can now make a call to Web API. First of all, set Authorization and Content-Type headers in your REST client.
Authorization: Bearer mc96LyRi9nUQySSjKXEf8xfqUZzjS2CYhRK8bWSRRfQi
Content-Type: 'application/json'
Endpoints
Base path: https://app.approval-path.com/webapi
Definition
ref-id
- In the case of Approval Path for Confluence, this is space id.
List of space definitions
GET /approval-definitions/{ref-id}
List of global definitions
GET /approval-definitions
Approval
ref-id
- In the case of Approval Path for Confluence, this is page id.
List approvals
GET /approvals/{ref-id}
Return example:
When Change Performer Origin 'USER' is selected for API key approval create and delete requests can be extended to include the userId
field.
Create approval
POST /approvals/{ref-id}
Delete approval
Allows the user to delete ongoing or finalized approval path on an issue.
DELETE /approvals/ref
DELETE /approvals/ref/id
*ref = page id
*id = Approval id (approval id can be found by using DevTools)
Â
Body parameterscreateComment
- Default false
. If true
, will generate a comment when the approval path is deleted via API. The creator of the API will be specified as the agent.