BETA

By using Postman, you will be able to test your first requests via Sage Active Public API V0.

We are going to :

1. Add the collection and the environment in Postman

Download the Sage Active Public API collection for Postman
Download the Sage Active Public API environment for Postman

  1. Open Postman, go to Collections.
  2. Click on Import.
  3. Click on Choose Files.
  4. Select and open the first downloaded file: Sage Active Public API V0.postman_collection.json.

Repeat the same operation for the second file:

  1. Stay in the same place.
  2. Click again on Import.
  3. Click on Choose Files.
  4. Select and open the second downloaded file: Sage Active Public API.postman_environment.json.

    img

The collection Sage Active Public API is now available in Postman. img

As well as the environment Sage Active Public API img

2. Authentication process

Complete the list of variables

  1. Click on Environment in Postman to see the environment named Sage Active Public API.
  2. Click Sage Active Public API

    Note that this environment already has the following values set for :

    baseAddress
    AuthUrl
    accessTokenUrl
  3. Fill in CURRENT VALUE column following values that you will retrieve from the Solutions tab of your application :

    Attention
    In the context of this quickstart, for scopes, please choose :
    RDSA Read Sage Active Data and WDSA Write Sage Active Data to remain consistent with the rest of the journey and the read and write permissions you just granted in your application.

    • In callBackUrl VARIABLE, the first Callback URL that you have filled,
    • in clientId VARIABLE, the Client ID,
    • in clientSecret VARIABLE, the Client Secret,
    • in scopes VARIABLE, the Permissions :

      • RDSA if you have chosen Read Sage Active Data
      • WDSA as well if you have chosen Write Sage Active Data
    • in subscriptionKey VARIABLE, the Subscription Primary key.
  4. Click Save

    img

    Remember, get the values from the Solutions tab of your application: img

Ask a New Access Token

  1. Go to Collections and choose Sage Active Public API.
  2. In the header, on the right, choose the environment Sage Active Public API.
  3. Open folder Authenticate and choose your organization, then Oauth Authentication.
  4. Click Auth tab,
  5. Then click Get New Access Token button.
    img

Note that all parameters of this Auth tab that contain variables will have their values populated by the variables defined in the chosen environment.

img

  • Check that the CallBack URL mentioned in the environment variable is the same as the one of your application :

    img

Authentication checking

You will now be prompted to login to your application.

3. Choose an organization and request the list of Journals

For our example we are going to request :

Request the tenant id

  1. First, check in the environment Sage Active Public API, if the variable accessToken is now filled.

    Otherwise, without access Token you cannot query the current Tenant Id and you need to repeat the previous step.

    img

  2. Click on the Sage Active Public API collection and open folder Authenticate and choose your organization.
  3. Click on Q.userProfile - {{X-TenantId}} filled in,
  4. then click Send button.
  5. Information about the authenticated user is returned by the API, including activeTenantId which contains the id of the tenant. img

    Tips and tricks
    For simplicity, the Tests tab contains a script that automatically adds the id to the X-tenantId variable of the environment.
    The X-tenantId will then be known by the whole collection.

Request the list of organizations

  1. First, check in the environment Sage Active Public API, if the variable X-tenantId is now filled.

    Otherwise, you cannot query the list of organizations and you need to repeat the previous step.

    img

  2. Now click on Q.organizations List - choose one and manually fill in {X-OrganizationId},
  3. then click Send button.
  4. The list of organizations of the current tenant is returned by the API. img

    Just click on Body to find out.

    img


Define your organization as variable

  1. Choose your organization, then select its id (without quotation marks),

    We suggest you choose the Bijou SA organization that contains a dataset that will help you use this collection.

  2. then right click and select Set: Sage Active Public API (without quotation marks),
  3. then select X-OrganizationId to save the id in the variable.

    img

Request the list of journals

  1. First, check in the environment Sage Active Public API, if you have now a value for X-TenantId and X-OrganizationId

    Otherwise, you cannot query the list of journalTypes of the organization and you need to repeat the previous step.

    img

  2. Return in the collection and open the folder Reference : related to an organization.
  3. Open sub folder Journal Types.
  4. Click on Q.journalTypes - first id filled in {{currentId}},
  5. then click Send button.
  6. The list of journals is returned by the API.

    img

    • Click Body tab
    • As an example, to obtain only the list of journals of type purchase or sales, add a where expression :
      query {
      journalTypes (
          where:{ type:{in: [PURCHASE_INVOICE, SALES_INVOICE]}}
      ) {
          edges {
      

    img


Well done!

You have just executed your first requests to Sage Active Public API V0.

Now continue to discover the collection :

  1. Discover queries with filters, sorting and pagination.
  2. Discover mutations to create, update, delete.
  3. Reference of all objects common to all organizations with all available queries and mutations.
  4. Reference of all objects related to an organization with all available queries and mutations.

Then you will be able to start developing your first application.
img

To maintain consistency, take account of current FR, ES or DE legislation and optimize data additions, we recommend you test queries on the BIJOU organization.

Please also note that certain values are defined in the Pre-request Script and Test tabs.
The green light indicates whether scripting has been defined:

img

img