Create your First Request
Less than to read
Using Postman, you can create your first request to the Accounting API. The requests used in this Quick Start Guide are available as a Postman collection. Click Run in Postman to load the collection into Postman. We recommend using the Postman desktop app.
Postman uses default callback url’s which you’ll need to add to your application in the app registry.
- https://www.postman.com/oauth2/callback - Postman app
- https://oauth.pstmn.io/v1/browser-callback - Postman browser
Or, manually import the Postman collections
-
Download the Postman collections for Contact Endpoints.
-
Open Postman and click Import.
-
Select the Accounting Postman Collection files.
-
The Collections are now ready to use in Postman.
Select Your Request
-
Click on the Collections tab in Postman to view the imported Accounting collections. The Postman Collection contains common requests you can make to the Accounting API. In this guide, we’ll be requesting Countries INDEX.
-
Click on Sage Accounting API - Contacts in your Collections sidebar, then open the countries folder.
-
Click on Returns all Countries.
Authorise API Access
-
In the Authorization tab, set the Type to OAuth 2.0 and add authorisation data to Request Headers.
-
Click Get New Access Token.
-
On the Get New Access Token screen, first enter the callback URL you set when you created your app.
-
Copy and paste the URLs below into Auth URL and Access Token URL fields.
- Enter the Client ID and Client Secret you generated when you created your app.
- Set the Scope to full_access and set State to any random value.
- Set Client Authentication to Send client credentials in body.
- Click Request Token.
-
You will be taken to the login screen of Sage Business Cloud Accounting. Enter the credentials of the account you’ve already created and click Login.
-
You will then be prompted to give Postman permission to your Sage Business Cloud Accounting data. Click Allow.
-
You now have an access token! Click Use Token.
The access token will be valid for 5 minutes. You will then have to require a new access token as described above. In your own app, you should refresh the token after its expiration, so the user needs to grant access only once.
Making a Request
- Click on Send to perform your first API call.
-
Your response will be shown as a JSON structure. You just made your first request!
Next: Test data preparation