API

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 Jira > API Keys > Create a new API Key

Then add the Authorization header to your HTTP request:

Authorization: Bearer mc96LyRi9nUQySSjKXEf8xfqUZzjS2CYhRK8bWSRRfQi

Endpoints

Base path: https://app.approval-path.com/webapi

Approval

ref-id- In the case of Approval Path for Jira, this is issue id or issue key.

List approvals

GET /approvals/{ref-id}

Return example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 { "result": [ { "id": "38", "definitionId": "35", "name": "Approval Name", "summary": "Ticket Summary", "collectionId": "10002", "refId": "10004", "steps": [ { "type": "USER", "status": "SUCCESS", "userId": "557058:aea7ac02-75c1-4f47-9beb-dd89777d4949", "displayName": "Krzysztof Bogdan", "avatarUrls": { "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/48", "32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/32", "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/24", "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/16" }, "action": "STARTED", "decision": "ACCEPTED", "decisionDate": "2021-09-30T13:51:01.676+00:00" } ], "status": "IN_PROGRESS" } ], "totalCount": 1 }

Create or get approval

POST /approvals/{ref-id}

1 2 3 4 { "definitionId": "id", "summary": "Approval summary. Usually issue/page title" }

Reset approval

Allows user to reset ongoing or finalized approval path on an issue.

POST /approvals/{ref-id}/reset

Body parameters
createComment - Default false. If true, will generate a comment when approval path is reset via API. The creator of the API will be specified as the agent.

1 {}

This will reset the approval path - by default no comment will be generated.

1 {"createComment": true}

This will reset the path and generate a comment.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 { "result": [ { "id": "469", "definitionId": "197", "name": "QA", "summary": "QA-33 Demo task", "collectionId": "10000", "refId": "10068", "steps": [ { "type": "USER", "type": "USER", "status": "SUCCESS", "userId": "6105b29ec51f3a0069c9ccda", "displayName": "Parsa Shiva", "parallelGroupNumber": null, "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "32x32": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "24x24": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "16x16": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png" }, "action": "STARTED", "decision": "ACCEPTED", "decisionDate": "2022-09-26T15:32:42.340+00:00", "lastUpdated": "2022-09-26T17:32:42+02:00" }, { "type": "USER", "type": "USER", "status": "SUCCESS", "userId": "6105b29ec51f3a0069c9ccda", "displayName": "Parsa Shiva", "parallelGroupNumber": null, "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "32x32": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "24x24": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", "16x16": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png" }, "action": "APPROVAL", "decision": "ACCEPTED", "decisionDate": "2022-09-26T15:32:52.128+00:00", "lastUpdated": null }, { "type": "USER", "type": "USER", "status": "SUCCESS", "userId": "6299df401648f2006963deb8", "displayName": "Jessica Smith", "parallelGroupNumber": null, "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "32x32": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "24x24": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "16x16": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png" }, "action": "APPROVAL", "decision": "ACCEPTED", "decisionDate": "2022-09-27T09:23:07.459+00:00", "lastUpdated": null }, { "type": "USER", "type": "USER", "status": "SUCCESS", "userId": "6299df401648f2006963deb8", "displayName": "Jessica Smith", "parallelGroupNumber": null, "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "32x32": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "24x24": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png", "16x16": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png" }, "action": "APPROVAL", "decision": "ACCEPTED", "decisionDate": "2022-09-27T09:23:10.706+00:00", "lastUpdated": null } ], "status": "SUCCESS", "activeSteps": [], "modificationDate": "2022-09-27T09:23:10.706+00:00" } ], "totalCount": 1 }