Cenit has been designed to integrate solutions by orchestrating data flows that may involve several APIs, so being able to connect to an API is one of the basic functionalities that are supported.
Most of the core concepts of Swagger 2.0 API specification can be associated with a corresponding one in Cenit. Based on this we have built a translator to convert a Swagger 2.0 specification into a Cenit Collection Format and we have used it to translate the Google APIs specifications available at the APIs.guru repository.
Now there are available on Cenit.io over 80 API collections to connect with the Google services that can be used to integrate with any solution. With Cenit you can have full access to an entire API through a single authorization point and customize responses actions to fit your needs. There are over 200 APIs specifications on the API Guru repository, we are working on to bring them to Cenit users, so follows us to get updated about that.
You can easily try an API by following the next steps by yourself signing up for free in Cenit.
Trying a Cenit API Collection
Execute the Pull action on the API shared collection you want to use and fill the pull parameters if needed:
Once you have successfully pulled the shared collection check for the OAuth2 authorizations and execute the Authorize action:
Cenit implements several authorization protocols. Specifically in the case of Oauth 2.0 it will prompt the provider page for the user consent and store the access token on the user account. Cenit is also capable of automatically refresh the access tokens if they are needed and have expired.
Now you have authorized Cenit to access the API, you are ready to try it. Just go to the Webhook model and select one to try:
When the Submit action is executed the first step is to choose the connection to be used for the webhook submission. First you have to select the default connection and click next, then Cenit builds a form to let you specify the parameter values that are initially fulfilled with the default ones.
Cenit is a concurrent system so every action with a time-processing charge is executed asynchronous. So once you have submitted your data just go to the Notification model and check if your submission task is done. The API responses are stored as notification attachments so click them to see the content:
And that’s all, you have successfully connected with an API through Cenit.
Swagger 2.0 Cenit Collection
By combining every scheme with the basePath on a Swagger 2.0 specification, the possible URLs that API can accept can be defined. Those URLs can be mapped into the Cenit Connection model. The paths specification ,on the other hand, should be mapped into the Cenit Webhook model.
Both models, Connection and Webhook support the specification of parameters, which are of three kinds: headers, parameters and template parameters. Swagger 2.0 API specification characterize every parameter with the location entry 'in', which specify where the parameter should be used: header query or path. While 'header' parameters are semantically the same concept on Swagger 2.0 and Cenit, the 'query' parameters should be mapped to 'parameters' and the 'path' parameters should be mapped to 'template parameters'.
Swagger 2.0 uses a JSON Schema like specification to describe the structure of the API resources and the format of parameters. Cenit supports the definitions of data types based on JSON schema, so all the definitions of a Swagger 2.0 can be mapped into a Library of Data Types.
Security definitions can be mapped into Cenit Authorizations. In the case of OAuth2 security protocol, the API may define different scopes for each path. Cenit can associate authorizations to connections and webhooks. For convenience, all paths OAuth2 scopes can be factorized and included in a single OAuth2 Authorization for the entire API. By assigning such authorization to the default API connection all webhooks become automatically authorized.
Interacting with an API may be a little awkward. For example, the Gmail API exchanges email data in MIME format, encoded following a base64 protocol. We are working on Cenit Collections built on top of the API ones to bring you a set of intuitive collection to make integrations very much easier, so follow us to get the latest news about Cenit Collections, we will come very soon with more of that.
Back to blog Get in touch