Postman Collection
What is Postman?
Postman is a third party tool used by developers across the world for building and using APIs. In our use case, we have created Postman collections for both authentication methods and an environment variables file that will allow you to use Postman to import and then test the Intelligent API endpoints.
Postman can generate code snippets from API requests as well, this can be very useful when integrating with any API. For a guide on how to do this visit Generate code snippets from API requests.
Pre-requisites
- Postman (https://www.postman.com/downloads/) installed
How to use
Download Files / Clone Repo
To start you first either need to clone the Intelligent API Postman Collection repository from Github or download the files locally.
For more information see either:
- Cloning a repository
- Downloading files from GitHub
Environment Variables Setup
- To begin ensure you have signed up at https://dash.intelligent-api.com and have generated at least one set of credentials (either OAuth Authentication or Basic Authentication).
- Within Postman, select
Collectionsand thenImportand browse to and select theintelligent-api.postman_environment.jsonenvironment variables file. - Once the environment has been imported, select
Environmentswithin Postman and navigate to theintelligent-apienvironment. - If you have setup OAuth Credentials in Step 1, update the
clientIdandclientSecretvalues in the environment. - If you have setup Basic Credentials in Step 1, update the
basicAuthClientIdandbasicAuthClientSecretvalues in the environment. - Ensure you save your changes before continuing.
Using the OAuth Collection
- If you have setup OAuth Credentials in Step 1 of the Environment Variables Setup you will need to navigate back to
Collectionsin Postman and then selectImportagain, and this time import theIntelligent API.postman_collection.jsoncollection file. - Once the collection has been imported, you will see the
Intelligent APIcollection in your list of Postman collections. - Ensure you select the
intelligent-apienviroment in Postman on the far top right drop down before starting to use the collection. - Once the collection has been imported and the environment has been selected, you should be able to begin by generating a
tokenthat you can use for subsequent API calls, to do this invoke the02 Request Token(see Request a token) endpoint in the root of theIntelligent APIcollection.
NB: When generating a token, you will only be able to specify
scopesthat the credentials you generated were granted access to when you created them in the https://dash.intelligent-api.com dashboard. So for example if you created credentials and unticked some of the scopes, you cannot include those scopes when requesting a token and subsequently can also not invoke any endpoints that require those scopes.
For more information on the Scopes and which endpoints require which Scopes, please see Scopes.
- This method will generate a token and place it into your environment variables for use with the rest of the endpoints, so once you have generated a token you will be able to invoke all the API endpoints the token has relevant scope to invoke for 4 hours before needing to generate a new token.
- The
Documentendpoints all require files as input, and to send a file to the endpoint simply select theBodytab, then selectbinaryfor the format and use theSelect Fileinput to browse for and select an appropriate file.
Using the Basic Auth Collection
- If you have setup Basic Credentials in Step 1 of the Environment Variables Setup you will need to navigate back to
Collectionsin Postman and then selectImportagain, and this time import theIntelligent API - Basic Auth.postman_collection.jsoncollection file. - Once the collection has been imported, you will see the
Intelligent API - Basic Authcollection in your list of Postman collections. - Ensure you select the
intelligent-apienviroment in Postman on the far top right drop down before starting to use the collection. - Once the collection has been imported and the environment has been selected, you should be able to invoke any of the API endpoints.
NB: When using
Basic Credentials, you will only be able to invoke endpoints that the credentials were granted access to when you created them in the https://dash.intelligent-api.com dashboard. So for example if you created credentials and unticked some of the scopes, you cannot invoke endpoints that require those scopes.
For more information on the Scopes and which endpoints require which Scopes, please see Scopes.
- The
Documentendpoints all require files as input, and to send a file to the endpoint simply select theBodytab, then selectbinaryfor the format and use theSelect Fileinput to browse for and select an appropriate file.