Postman
Last updated
Last updated
As of July 2024, there have been changes in the use of the environments. Please import the environments as specified in this documentation AND the updated fulfillmenttools API collection.
During the development of fulfillmenttools as an API-first product, the design, documentation, and testing of the APIs are taking a high priority. Therefore, a wholesome collection is in use and frequently updated with new requests as they appear in the API.
This page shares this resource with developers or other technical personnel to ease access to the fulfillmenttools RESTful API and share concrete examples.
Postman divides its functionality into several categories such as collections, environments, mock servers, etc... For documentation purpose fulfillmenttools provides a template environment and the collection of calls towards fulfillmenttools RESTful API. In order to work with the collection you need to import the environment into Postman and fill in the data as described below.
Two environments are necessary to work with Postman, one global and one tenant-specific. To create the global one, and import it into Postman. on how to import an environment into Postman.
The same step must be done with the tenant-specific environment. An example file is (don't forget to replace the ocff-example-prd
with the correct projectId
).
The tenant-specific environment has to contain the projectId
:
projectId
The id of the used project.
ocff-example-prd
The global environment must contain the host
value:
host
The Host of your fulfillmenttools platform environment
https://{{projectId}}.api.fulfillmenttools.com/
------
{{projectId}}
is right here, leave it like it is.
When using Postman, more variables will occur in the environment. Be advised that especially authTokens
& refreshTokens
will be stored in the environment of the Postman Instance you are using.
Once you successfully imported the collection, you are presented with a view similar to this:
To prevent the sync of sensitive data into the Postman Cloud, we use the Postman Vault. This is a local encrypted storage that is not synced to Postman. Accessible is Postman Vault in the Postman IDE in the bottom right corner with the Vault-Button.
Now, the following variables have to be set. Replace {projectId}
with the actual project id in the shape of ocff-example-prd
, so that the variables look like, e.g. ocff-example-prd-user
.
{projectId}-user
The user that exists in the system, usually in the form of an email. Please include the host part of the login.
user@ocff-example-prd.com
{projectId}-password
The password of the user.
{projectId}-api-key
The api key to our IdentityProvider to generate a AuthToken
AIZaSyCvIDK187vJWfl5EICJ_g_bNyvdARhdeXw
The documentation on how to Make your first API Call says we need to issue at least two calls to communicate with the API: First, we need to get an Auth Token and then use this Auth Token in our call towards the fulfillmenttools API. Let's do exactly this using Postman:
After the call has successfully been executed, the response is received from the IdentityProvider containing (among other data) the actual authToken and a refreshToken, which are used for calls against the fulfillmenttools API.
Both values are stored as environment variables - you do not need to copy those!
Now we can run every call in the collection - in this example, we will request the list of facilities:
Now, you are ready to go and adapt and execute the other calls or create new requests.
Similar to setting up an environment, you can import the collection of Requests into Postman. Please and import it into Postman as described .