Create an API Security Token
API tokens are small snippets of code that are built to secure API access. These tokens are sent to API servers. The API servers use the tokens to identify and authenticate a user or application before sharing information.
To use Sparkrock 365 APIs, you must create a security token, which is also referred to as a Bearer token.
To create a security token, you must perform the following steps:
Register Sparkrock 365 with the identity platform in Microsoft Entra ID.
Configure a new token with an API platform, such as Postman.
Register Sparkrock 365 with the identity platform in Microsoft Entra ID
Sparkrock 365 must establish trust between itself and the Microsoft identity platform. To establish that trust, Sparkrock 365 must be registered with the identity platform in Microsoft Entra ID.
To register Sparkrock 365 with the identity platform in Microsoft Entra ID
Open a web browser, and go to Microsoft Entra ID (https://aad.portal.azure.com/).
Sign in.
You can use the credentials that you use to sign into Sparkrock 365.
On the Home tab, choose Microsoft Entra ID (Azure AD).
From the menu at the top of the page, choose Add > App registration, and then after the Register an application page opens, perform the following steps:
- In Name, specify the name of your application.
- Under Supported account types, ensure that the Accounts in this organizational directory only (<company name> - Single tenant) radio button is selected.
- Under Redirect URI (optional), in the Select a platform dropdown field, select Web, and then in the next field, specify the following redirect URI:
https://sparkrock365.bc.dynamics.com/OAuthLanding.htm - Choose Register.
A new page opens.
In the left menu, choose Certificates & secrets, and then perform the following steps:
- Ensure that you are on the Client secrets tab, and then choose New client secret.
A Add a client secret panel opens. - In Description, specify a description for this client secret.
- In Expires, specify a value, for example, 730 days (24 months).
- Choose Add.
The Add a client secret panel closes. - Copy the value of the Value field, and then paste the value somewhere so you can reference this information later.
When you configure a new token, Postman requires that you input this value.
- Ensure that you are on the Client secrets tab, and then choose New client secret.
In the left menu, choose API permissions, and then perform the following steps:
- Choose Add a permission.
A Request API permissions panel opens. - Choose Dynamics 365 Business Central.
- Choose Delegated permissions.
- Select Financials.ReadWrite.All, and then choose Add permissions.
- Choose Add a permission.
In the left menu, choose Overview, and then perform the following steps:
- Copy the value for Application (client) ID, and then paste the value somewhere so you can reference this information later.
When you configure a new token, Postman requires that you input this value. - Choose Endpoints.
- Copy the value for OAuth 2.0 authorization endpoint (v2), and then paste the value somewhere so you can reference this information later.
When you configure a new token, Postman requires that you input this value. - Copy the value for OAuth 2.0 token endpoint (v2), and then paste the value somewhere so you can reference this information later.
When you configure a new token, Postman requires that you input this value.
- Copy the value for Application (client) ID, and then paste the value somewhere so you can reference this information later.
Configure a new token with Postman
After registering Sparkrock 365 with the identity platform in Microsoft Entra ID, you can configure a new token with Postman.
To configure a new token with Postman
Open Postman.
On the Authorization tab, In Type, specify OAuth 2.0.
In the Configure New Token section, perform the following steps:
- Ensure that Grant type is set to Authorization Code.
- In Callback URL, specify the following:
https://sparkrock365.bc.dynamics.com/OAuthLanding.htm - In Auth URL, specify the value that you copied from OAuth 2.0 authorization endpoint (v2) while registering Sparkrock 365 with the identity platform in Microsoft Entra ID.
- In Access Token URL, specify the value that you copied from OAuth 2.0 token endpoint (v2) while registering Sparkrock 365 with the identity platform in Microsoft Entra ID.
- In Client ID, specify the value that you copied from Application (client) ID while registering Sparkrock 365 with the identity platform in Microsoft Entra ID.
- In Client Secret, specify the value that you copied from Value while registering Sparkrock 365 with the identity platform in Microsoft Entra ID.
- In Scope, specify the following:
https://api.businesscentral.dynamics.com/Financials.ReadWrite.All - Choose Get New Access Token.
- Sign in.
You can use the credentials that you use to sign into Sparkrock 365.
If you are prompted to accept permissions, choose Accept. - To use the new token, choose Use Token.
See also
Feedback
To send feedback about this page, select the following link: