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)  Import Mongoose Postman requests:

Running Postman for the first time, you'll see a screen that looks like this:

Select "Import" from the upper left, and use the "Import from Link" option:

Enter the following URL: https://www.getpostman.com/collections/93de7af51452d25a19f1

When that is complete, you should find a new Collection titled "Cadence External API" 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