Introduction
There are many different types of API out there that IGUANA can integrate with. Here are a few tricks to make it faster and easier to integrate with external APIs.
This article includes tips for: How to use SSL authentication with OAuth1 or OAuth2, and using Postman or SoapUI to build test messages. These techniques will work with a wide range of APIs and can help you to speed up channel development.
Task [top]
Techniques to integrate quickly and easily with external APIs.
Oauth authentication and SSL [top]
There are two types of Oauth authentication:
- OAuth1: This requires a static token:
- OAuth2: This requires a dynamic token:
A dynamic token will need to be regenerated after a specified period of time. A user account is needed to manage token refresh.
{ "access_token": "{ACCESS_TOKEN}", "refresh_token": "{REFRESH_TOKEN}", "token_type": "bearer", "expires_in": 1209600 }
There are two ways to set up SSL:
Using SSL with Oauth is strongly recommended so that the your Oauth tokens are protected by being transmitted in an encrypted format. If you do not encrypt your tokens then they are visible and can be stolen by a “man in the middle” attack.
- One way SSL: This is the easiest method to use with Iguana.
Using one way SSL is the most suitable method for Iguana — since IGUANA supports this in the From HTTP socket and the translator net.http API library
- Two way SSL:
Building test messages [top]
Here are some tips for creating and using test messages:
- Use API tools like Postman or SoapUI to create test messages:
The fastest/easiest way to build sample test messages that will be accepted by an external API server is to use other API tools like Postman or SoapUI.
- Some APIs supply their own custom build TEST API client:
Most Public API server (like Harvest) have testing support for Postman or SoapUI. If not they will usually have their own custom build TEST API client
- The fastest way is to do the following:
- Use Postman to create a message that is accepted by the API you are using.
Create a sample message and test it against the API you are using. Once you have a message that is working correctly you can use it Iguana.
- Build an Echo From Http channel in Iguana.
- Use Postman to send the same message to the Iguana Echo From HTTP channel.
- Analyze the HTTP request in the Translator:
- Use Postman to create a message that is accepted by the API you are using.