How to draft new APIs with IBM API Connect

How to draft new APIs with IBM API Connect


IBM API Connect makes it easy to define, manage,
and leverage existing APIs. In this example, we’ll use the GitHub API
to show how quickly you can start creating and testing APIs with API Connect on IBM Cloud. Let’s start by creating a catalog from the
API Connect Dashboard. The catalog will allow you to organize your
APIs and manage access. Next, open the drafts panel and create an
API definition. You can enter any name you want for the title. The “Base Path” is essential here, as
it sets the starting point for the request.path property that you can use when designing your
API. We will look more into that property and context
variables in next steps, so clear its value for now. Once you create the API, you can start defining
its features in the “Design” view. There is a lot here so we will stick to the
basics of creating and manipulating paths. Click “Paths” in the left navigation bar
to start creating a new path. Paths help to build the request.path variable. Define a path called organizations to correspond
to the organizations resource on api.github.com. An HTTP GET method will be added for this
path automatically, but you can specify any HTTP verb you would like and you can add multiple
verbs as well. The gateway will use the combination of a
verb and path to choose the corresponding action to execute. Save the design and head over to the API Assembler. Click the invoke statement and change the
target-url to api.github.com and request.path to the “context variable” mentioned earlier–
this will be a concatenation of our base path and the path of our specific request. Now, any time you will call the organizations
route on our gateway, it will call to api.github.com organizations. Save the assembly and then hit the right facing
arrow above the central assembly screen to test your API. Hit the Republish product button to refresh
the API definition in the gateway. This publishes the API into a default product
and the default catalog. Select the GET organizations operation and
then hit the blue invoke button at the bottom. Ready to start drafting your own APIs? Sign up for a free trial today

5 thoughts on “How to draft new APIs with IBM API Connect”

  1. I have signed up for free trial bluemix service but it does not work for me. Bluemi ix so unstable platform that you cannot know what the problem is and no way to troubleshoot the problem.

Leave a Reply

Your email address will not be published. Required fields are marked *