Skip to main content
Two files, generated from openapi.json, let you run every endpoint from Postman or from Newman. No key and no document is inside either file. Text copies for import by link: collection and environment. They hold the same JSON. The .json files are in the postman/ folder of the documentation package.

Import

  1. Open Postman. Click Import.
  2. Import the collection. Choose one way:
    • Link: paste https://docs.sahlfinancial.com/postman/sahl-partner-api.postman_collection.json.txt.
    • File: choose the downloaded sahl-partner-api.postman_collection.json.
    • Raw text: open the text copy above, select all, paste.
  3. Import the environment the same way. Its content is small enough to paste here:
  1. Select Sahl sandbox in the environment menu at the top right.
  2. Open the environment and set Current value of apiKey to your own key. Use the current value, not the initial value: Postman keeps current values on your machine and can sync initial values to a shared workspace. Create the key as described in Test in the sandbox.
Leave environment as sandbox. baseUrl is https://app.sahlfinancial.com/api.

The requests

Run them in order. Each stores what the next one needs. Before each request a collection script checks that apiKey is set, and adds a fresh X-Request-ID (a GUID) so you can find the call in Developers, Call log in the console.
Requests 5 to 7 start a real eID check and email the client, even in sandbox. Skip them unless your workspace has an eID provider account, and replace the email in the body with an address you control.

Files for requests 1 and 2

The collection holds no document. In requests 1 and 2, open the Body tab and click the files row to choose your own fake test file. The collection refers to them as payslip-test.pdf and cin-test.jpg as placeholders. Make the files yourself with invented data and do not upload a real client document: see Sandbox.

Variables

Request 3 and 4 put {{documents}} in the JSON body. Postman’s editor may underline it as invalid JSON before the run. It is replaced by the entries from requests 1 and 2 when you send.

What the scripts do

All scripts are plain Postman sandbox code. Request 1:
Request 3 first joins the stored entries:
A failing verdict is still HTTP 200, so a test that asserts 200 passes when passed is false. Add your own assertion if you want a failing run to fail the pipeline, for example pm.expect(body.passed).to.eql(true).

Run from the command line with Newman

Put payslip-test.pdf and cin-test.jpg in ./samples. --folder is given the request names here so that the eID requests are skipped. The collection and its scripts were run with Newman against a local stand-in server, not against the live API.