mySparkrock user properties and user permission set APIs
To set up mySparkrock user properties and user permission sets in Sparkrock 365, use the following APIs.
List of users
To get a list of all users, issue a GET users request.
The following JSON code snippet is an example of a GET users request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users Authorization: Bearer {token}
Properties of all users
To get the properties of all users, 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/microsoft/automation/v2.0/companies({companyid})/users({userSecurityId}) Authorization: Bearer {token}
Properties of a specific user
To get the properties of a specific user, specify filters when issuing a GET request.
The following JSON code snippet is an example of a GET request with filters specified.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users?$filter=userName eq 'sparkrockapi' Authorization: Bearer {token}
Modify user properties
To get the current user properties, issue a GET users request. This request gets the UserSecurityId that is required for subsequent requests.
The following JSON code snippet is an example of a GET users request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users?$filter=userName eq 'sparkrockapi' Authorization: Bearer {token}
To modify the user, issue a PATCH user request.
The following JSON code snippet is an example of a PATCH user request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users({userSecurityId}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "state": "Enabled", "expiryDate": "2035-01-01T21:03:53.444Z" }
List of permission sets
To retrieve a list of permission sets, issue a GET permissionSets request. This request returns information about the available permission sets.
The following JSON code snippet is an example of a GET permissionsSets request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyId})/permissionSets Authorization: Bearer {token}
List of user permissions
To get the list of all user permission for a specific user, issue a GET userPermissions request. This request gets the userPermissionId that is required for subsequent requests.
The following JSON code snippet is an example of a GET userPermissions request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users({userSecurityId})/userPermissions Authorization: Bearer {token}
Assign user permissions
To assign permission sets to a user, issue a POST request against the userPermissions entity.
The following JSON code snippet is an example of a POST request against the userPermissions entity.
POST https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyId})/users({userSecurityId})/userPermissions Authorization: Bearer {token} Content-type: application/json { "roleId": "SECURITY", "company" : "Sparkrock" }
Delete user permission
To get the current user permissions, issue a GET userPermissions request. This request gets the UserSecurityId that is required for subsequent requests.
The following JSON code snippet is an example of a GET userPermissions request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyid})/users({userSecurityId})/userPermissions Authorization: Bearer {token}
To remove the user permission from the user, issue a DELETE userPermissions request on the users entity.
The following JSON code snippet is an example of a DELETE userPermissions request.
DELETE https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/microsoft/automation/v2.0/companies({companyId})/users({userSecurityId})/userPermissions({userPermissionId}) 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: