- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
Generating token with oAuth2 for Visma.Net API in Postman
- 0 Replies
- 1 kudos
- 9022 Views
Manage environments
Creating a new environment
You can create a new environment from the:
- Manage Environments icon
- New button
- Launch screen
Manage environments icon
Click "Manage Environments" icon in the upper right corner of the Postman app.
- Select “Manage Environments”.
- Click the Add button.
New button
In the header toolbar, click the New button or click the “Gear” Manage Environments icon
Click "Environment" and enter a name for the new environment.
Add the variables you want to save as key-value pairs.
Click the Add/Update button.
Manage Environments to change the values with your own
- base_uri:currently pointing to API environment <https://integration.visma.net/API>
- client_id: The client identifier given to the client during the Application registration process.
- client_secret: The client secret given to the client during the Application registration process.
- redirect_uri: (CallbackURL)The Application’s callback URL that’s registered with the server. If not provided, Postman uses a default empty URL and extracts the code or access token from it.
- company_id: Financials companyId that will be used on API calls
- scope:The scope of the access request {financialstasks}
- state: An opaque value that prevents cross-site request forgery
- auth_URL: The endpoint for authorization server, which retrieves the authorization code.<https://integration.visma.net/API/resources/oauth/authorize>
- Access_Token_URL: The endpoint for the resource server, which exchanges the authorization code for an access token. <https://integration.visma.net/API/security/api/v2/token>
oAuth2
OAuth 2.0 is an authorization type that enables you to approve an application that contacts another application for you without exposing your password.
To use the OAuth 2.0 authorization in Postman
- In the Authorization tab, select "OAuth 2.0" from the TYPE drop down menu.
- From the "Add authorization data to" drop down menu, select either "Request URL" or "Request Headers".
- To set the authorization parameters for a request, you have three options:
- Click the Get New Access Token button. The screen appears.
Enter the appropriate values, click the Request Token button to populate the "Access Token" field, and then click the Send button.
- In the "Access Token" field, enter a token, or an environment defined variable, and click the Send button.
- In the "Available Tokens" drop down menu, select an existing token and click the Send button.
|
After clicking the Get New Access Token button , Postman brings the following screen where user should fill out the parameters.
|
The values used here are the variables defined in the environment. After filling the parameters user needs to click Request Token button.
You will be directed to a Visma.net login, enter your credentials and sign in.
|
Allow Visma.net Integrations to connect to your account.
|
After you click the Allow button and if entered data is correct, you will see the Postman window that has the token.
By default Postman expects to find a field named: access_token in the response. Since the Visma.Net response contains a field named token , instead of access_token, Postman cannot auto-detect it as an access_token
|
Copy the value of token , close the MANAGE ACCESS TOKENS screen and paste it in the Access Token field.
We also recommend taking a look at :
Connecting your Visma.Net Financials company to the API