Approval group and approval group lines APIs
To set up approval groups and approval group lines in Sparkrock 365, use the following APIs.
List of approval groups
To get a list of all approval groups, issue a GET approvalGroups request.
The following JSON code snippet is an example of a GET approvalGroups request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups Authorization: Bearer {token}
List of properties for a specific approval group
To get a list of properties for a specific approval group, issue a GET request.
The following JSON code snippet is an example of a GET request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups({code}) Authorization: Bearer {token}
List of all approval group lines in a specific approval group
To get a list of all approval group lines for a specific approval group, issue a GET request.
The following JSON code snippet is an example of a GET request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups({code})?Expand=approvalGroupLines Authorization: Bearer {token}
Create an approval group
To create an approval group with approval group lines, issue a POST request.
The following JSON code snippet is an example of a POST request.
POST https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups Authorization: Bearer {token} Content-type: application/json { "code": "api-test", "description": "Api Test Approval Group", "blocked": false, "approvalGroupLines": [ { "sequence": 1, "approverType": "mySparkrock User", "approverNo": "APPROVER", "defaultApprover": false, "allMustApprove": false, "notificationOnly": false, "blocked": false }, { "sequence": 2, "approverType": "mySparkrock User", "approverNo": "AUDIT", "defaultApprover": false, "allMustApprove": false, "notificationOnly": false, "blocked": false } ] }
Modify approval group properties
To modify the approval group, issue a PATCH approval group request.
The following JSON code snippet is an example of a PATCH approval group request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroup({code}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "blocked": true }
Delete an approval group
To delete an approval group, issue a DELETE approval group request.
The following JSON code snippet is an example of a DELETE approval group request.
DELETE https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups({code}) Authorization: Bearer {token} If-Match: *
The request does not return anything in the response body.
List of approval group lines
To get a list of all approval group lines that are associated with all approval groups, issue a GET approvalGroupLines request.
The following JSON code snippet is an example of a GET approvalGroupLines request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroupLines Authorization: Bearer {token}
List of all approval group lines that are associated with a specific approval group
To get a list of all approval group lines that are associated with a specific approval group, issue a GET request.
The following JSON code snippet is an example of a GET request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups({code})/approvalGroupLines Authorization: Bearer {token}
Add an approval group line to approval group
To add an approval group line to an approval group, issue a POST request.
The following JSON code snippet is an example of a POST request.
POST https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroups({code})/approvalGroupLines Authorization: Bearer {token} Content-type: application/json { "sequence": 3, "approverType": "mySparkrock User", "approverNo": "ADMIN", "defaultApprover": false, "allMustApprove": false, "notificationOnly": false, "blocked": false }
Modify approval group line properties
To modify the approval group line properties that are associated with an approval group, issue a PATCH approval group line request.
The following JSON code snippet is an example of a PATCH approval group line request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroupLines({approvalGroupCode,sequence,lineNo}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "blocked": true }
Delete an approval group line
To delete an approval group line that is associated with an approval group, issue a DELETE approval group line request.
The following JSON code snippet is an example of a DELETE approval group line request.
DELETE https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/approvalGroupLines({approvalGroupCode,sequence,lineNo}) Authorization: Bearer {token} If-Match: *
The request does not return anything in the response body.
See also
Feedback
To send feedback about this page, select the following link: