API Testing and Code Generation With Postman

Overview

Cadence offers a modern, REST-like API to allow our clients to programmatically interact with contact and user data, as well as send messages.

Full documentation for the API is located online here:  http://api.mongooseresearch.com/docs/

If you're just getting started in your API journey, there are some useful tools that will let you explore an API and interact with it, without writing a line of code.

Postman is one such tool - it's available for Mac/Windows/Linux operating systems, and provides a full suite of functionality for interacting with an API - as well as tools for generating source code in multiple languages.


Getting Started

To get you started with our API, we're providing a collection of Postman requests that you can import, and then use to call the Cadence API, 

1) . Download and install Postman from here: https://www.getpostman.com/

2)  Follow the instructions to generate Mongoose API credentials.  These credentials provide a significant level of access to data within Cadence and should be handled securely.

3)  Create a fork for Mongoose Postman requests: 

Click the following URL to access the Cadence External API collection: https://www.postman.com/mongoose/workspace/mongoose-public-workspace/overview

You'll see a screen that looks like this:

You will need to create a fork of the Cadence External API collection to add to your workspace.

Next to Cadence External API click on the three horizontal dot menu>Create a fork

As you create the fork, you'll want to label it and select the workspace. You can also check to "watch original collection" which will update you anytime Cadence makes updates/changes to the Cadence External API.

When that is complete, you should find a new Collection with the name you just created with a set of requests representing the methods available.

4) The next step is to set the Api Key and Secret that you created in Cadence previously.  On the Authorization tab, select Basic Auth and then paste in your username and password (API Key and Secret). 


Request URLs

Some of the requests will have placeholders that will need to be completed with actual values.  For example, below, the URL for getting a contact is:

https://api.mongooseresearch.com/v2/contacts/:departmentCode/:mobileNumber

In the example below,  <departmentCode> and <mobile number> are required and should be replaced.

Nice work!  You've successfully connected to the Cadence API and retrieved a contact record!

Not all of the examples show all of the fields and options that are available - the  Mongoose API Docs should be referenced for the full set of details.


Code Generation

For next steps, you can actually use Postman to kick start the development process.  They provide a tool for generating code snippets in a variety of languages.  These will not be feature complete, with error handling, and safe storage of credentials, and any logic to get source data for your systems.

However, they are very useful to get a quick example of how to make the actual API connection, in a language of your choice.

Code generation is available using the "Code" button along the right side menut:

Snippets can be generated in a variety of languages, with additional choices for HTTP client library within those languages:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us