mySparkrock User APIs
The srf externalUsers APIs enables mySparkrock users to be set up in Dynamics 365 Business Central.
List of mySparkrock users
To get a list of all mySparkrock users, issue a GET externalUsers request.
The following JSON code snippet is an example of a GET externalUsers request.
GET https://api.businesscentral.dynamics.com/v2.0/{environmentname}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers Authorization: Bearer {token}
List of all properties for a specific mySparkrock user
To get a list of all properties of a specific mySparkrock user, issue a GET request with a filter.
The following JSON code snippet is an example of a GET request with a filter.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers?$filter=userName eq 'sparkrockapi' Authorization: Bearer {token}
Create a mySparkrock user
To create a mySparkrock user, 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})/externalUsers Authorization: Bearer {token} Content-type: application/json { "userName": "api-test", "firstName": "api", "middleName": "", "lastName": "test", "authenticationEmail": "api-test@CRONUS-DEMOSITE.COM", "allowAccessFrom": "2022-01-01", "allowAccessTo": "2025-12-31" }
Modify mySparkrock user properties
To get the current mySparkrock user properties, issue a GET externalUsers request. This request gets the UserSecurityId that is required for subsequent requests.
The following JSON code snippet is an example of a GET externalUsers request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers?$filter=userName eq 'api-test' Authorization: Bearer {token}
To modify the mySparkrock user, issue a PATCH mySparkrock user request.
The following JSON code snippet is an example of a PATCH mySparkrock user request.
PATCH https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers({userSecurityId}) Authorization: Bearer {token} Content-type: application/json If-Match: * { "allowAccessFrom": "2021-01-01", "allowAccessTo": "2027-12-31" }
Delete a mySparkrock user
To get the current mySparkrock user properties, issue a GET externalUsers request. This request gets the UserSecurityId that is required for subsequent requests.
The following JSON code snippet is an example of a GET externalUsers request.
GET https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers?$filter=userName eq 'api-test' Authorization: Bearer {token}
To delete the mySparkrock user, issue a DELETE mySparkrock user request.
The following JSON code snippet is an example of a DELETE mySparkrock user request.
DELETE https://sparkrock365.api.bc.dynamics.com/v2.0/{tenantId}/{environmentName}/api/sparkrock/srf/v2.0/companies({companyId})/externalUsers({userSecurityId}) 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: