How to build an API channel quickly

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:

  1. OAuth1: This requires a static token:
    static token oauth
  2. 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.

  1. 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

      1. This diagram shows how it works:
        one way SSL
      2. You can add SSL Certificate and Key files in the Web Server Settings:
        web server settings
    1. And you can also use SSL with the built in Iguana net.http API:
      net.http
  2. Two way SSL:
    1. This diagram shows how it works:
      two way SSL

Building test messages [top]

Here are some tips for creating and using test messages:

  1. 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.

  2. 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

  3. The fastest way is to do the following:
    1. 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.

    2. Build an Echo From Http channel in Iguana.
    3. Use Postman to send the same message to the Iguana Echo From HTTP channel.
    4. Analyze the HTTP request in the Translator:
      analyze http message

More information [top]

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.