3scale & Snaplogic Pipelines

This tutorial offers an overview of how to expose APIs for services integrated through SnapLogic and add API management capabilities using 3scale. This guide includes the setup for both solutions. Prior experience with SnapLogic and 3scale is not required.

First we’ll show how to expose RESTful APIs for service integrations created through SnapLogic pipelines. Then you will see how to secure, manage, and monitor these APIs using 3scale. We define application plans to allow more fine-grained analytics for each endpoint and provide information about 3scale’s Developer Portal and API monetization features.

Create Accounts

First, let’s create one account on each of the platforms:

  • 3scale. The process for creating an account in 3scale is really simple, just go to www.3scale.net and click on “Start free trial”. The wizard will guide you through the rest of the process and it will only take you a couple of minutes.
  • Snaplogic. To get started with SnapLogic, you can try their AWS Redshift trial or you can request a custom demo on their website.

Exposing APIs in Snaplogic

SnapLogic allows its users to expose any of the integrations (known as pipelines) they build in the graphical user interface as REST APIs, which can accept input requests/parameters and return responses based on the pipeline configuration. Follow these steps to achieve this:

  • Go to the SnapLogic Manager, select Tasks in your project and then select the “Triggered (External URL)” option when creating or updating a task – see figure below. (“Tasks” in SnapLogic are a way to access pipelines using a URL. The URL can also feed data into a pipeline and receive the output of the pipeline.)
Snaplogic integration
$ curl -u 'user@example.com:mypassword' https://elastic.snaplogic.com/api/1/rest/slsched/feed/example/jobs/test-reader 
{ "msg" : "Hello, World!" }

(For more details visit: http://doc.snaplogic.com/tasks)

SnapLogic also offers public, RESTful APIs that allow you to access platform features like creating users, groups etc. in a programmatic way. These APIs are readily available to use but require administrator privileges. Contact your SnapLogic admin to test the URLs. A complete listing of all the available APIs can be found here: http://doc.snaplogic.com/public-api-documentation

API management configuration in 3scale

After logging in to your 3scale account, you’ll see a dashboard of the most important performance figures for your API.

Snaplogic 2

Select the “API” tab from the navigation panel at the top. Then choose “Integration” on the left-hand side to start configuring your API management options.

Provide the “Private Base URL” representing the API of your SnapLogic pipeline. A SnapLogic cloud URL will look similar to the one shown in the screenshot below. You can apply any additional mappings or authentication settings, then validate the API by curl command and/or REST clients.

Debugging tip: When configuring your REST client, ensure that both the 3scale and SnapLogic credentials are being sent as part of the headers as shown in the Postman screenshot below.

The “user_key” refers to 3scale as one of the API security mechanisms. (Information on the access control and security options provided by 3scale can be found here)

The “authorization” field is passed on from SnapLogic and used as a username+password pair for authorization.

Once this is complete, you’re all set to monitor your SnapLogic APIs through the 3scale API gateway.

You can now explore API monitoring options in the “Analytics” tab. It will show information about the usage of your API (total number of API calls in this case) over a period of time:

You can also configure more fine-grained API control and analytics functionality, so you can manage and monitor every single endpoint that your SnapLogic pipeline API provides.

For example, assume that this pipeline has two endpoints that you want to manage separately, a GET endpoint and a POST endpoint. You can define and configure rules as metrics for each endpoint, and even define specific pricing and rate limits for each metric, as seen here:

Next, you’ll map your metrics onto the endpoints. To start, go back to the “Integration” section of the navigation panel on the left, and define “mapping rules” in the corresponding section in the middle. Define the HTTP verb (here GET or POST), enter the endpoints’ URLs, and choose one of the metrics that you defined in the previous step.

If you now switch back to the “Analytics” tab, you should still see the total number of API calls. On the right-hand side, you can drill down to get an accurate count of API calls against each endpoint, just as seen on this picture:

You can find a lot more detailed information about what you can do with 3scale’s rate limiting, analytics features, and application plans features on the Analytics guide.

You can also create a one-stop-shop developer portal and configure a payment gateway to monetize your APIs.

The 3scale API Management Platform includes a ready-made Developer Portal, which supports all your necessary onboarding processes and can be fully customized to your brand specifications. It provides interactive API documentation based on the Swagger framework, which helps increase adoption by allowing developers to get to know your API before they even integrate with it. The screenshot below shows how it works. You can find more information about it here:

3scale also makes it possible to monetize access to your APIs with automated billing. Options for pricing plans and rules are flexible and can be defined according to your requirements. Find more information about how to charge for use of your API here.

For additional questions, please contact: Vish Srinivasan or Manfred Bortenschlager