Kloudless Blog

Kloudless Unified APIs enable you to code once and integrate many

We’re excited to announce that Kloudless developers now have access to a pre-built Postman collection to quickly connect accounts and test out API requests. Try it out here:

Kloudless is a unified API platform that enables you to easily integrate several cloud services with a single implementation. Postman is an API development environment that streamlines testing and development with APIs.

The Kloudless Postman collection contains endpoints that allow you to interact with a myriad of different cloud storage services (Storage API), as well as endpoints utilized in managing the Kloudless application and its users (Core API). We plan to add other APIs like the Calendar API and the CRM API in the future.

This collection works in conjunction with Postman’s environment variables to help facilitate usage. To get started, you will need a Kloudless account. If you don’t have one, you can sign up for one here. If you already have an account, you can log in to get started.

How to connect a cloud provider account to your Kloudless app via Postman

There are two ways to connect a cloud service account such as a Google Drive account to Postman to make API requests with.

  • The first way requires you to proceed through the OAuth 2.0 flow via the Kloudless API Explorer, and copy the generated token into the Postman environment variables to authorize the request. This is an easy way to quickly get started with the Postman collection.
  • The second way utilizes Postman’s built-in OAuth 2.0 implementation. The built-in OAuth 2.0 implementation may be helpful if you are familiar with Postman collections, and also allows you to generate new Bearer Tokens without using the Kloudless API Explorer. This method is more complex than the first but lets you manage multiple connected accounts with distinct tokens.

To use Kloudless’ API Explorer to generate a Bearer Token, navigate to the API
Explorer
, and connect an account to your Kloudless app. This will supply you with a Bearer Token. Copy and paste this value into the Kloudless environment, as the ‘Current Value’ for the {{accessToken}} variable. Now any API request made from the Postman application will include the Bearer Token.

The second method will require you to navigate to the Authorization tab for the
Kloudless collection. Right click on the collection, select ‘Edit’, and then
select the Authorization tab. You should see a section that looks like this.

auth

Click on the Orange ‘Get New Access Token’ button. You will see a small form
asking for several pieces of information. It should look something like this:

oauth2

Here is a breakdown of what you will need to enter on the form:

* Token Name – The name you choose does not have an impact on the token’s
viability, choose whatever name you see fit. Keep in mind, you will be able to
generate and save many different tokens so descriptive names can be useful.
* Grant Type – Select ‘Implicit’.
* Callback URL – This must be a valid URL format. You will also need to add
this to the list of registered Redirect URIs for your Kloudless application. You
can add that on the Details page for your Kloudless App. Note: You can use any valid URL when testing with Postman, such as http://postman.local, since Postman directly retrieves the access token from the pop-up window. Just be sure to add the URL to both the Postman collection and the Kloudless application’s list of redirect URIs.
* Auth URL – Add the Kloudless OAuth URL,
https://api.kloudless.com/v1/oauth.
* Client ID – Use the Kloudless App ID for this value. This can also be found on the Details page for your Kloudless App.
* Scope – Setting this to any:all.all will prompt the user to select the cloud service to authenticate. You can restrict this to just the services you need by setting the scope as defined on our documentation of the OAuth flow.
* State – You can set this value yourself, however Postman has some built-in dynamic variables that can assign a random integer here, {{$randomInt}}.
* Client Authentication – Select ‘Use as Basic Header’.

Performing API requests

That’s it! Once you’ve connected an account or added in the token, Postman automatically authorizes all API requests with the appropriate header.

If this is your first time using Kloudless, there is a small collection of API calls titled “Get Started” to quickly walk through some basic functionality.

Check out our Docs for a full description of each API endpoint’s capabilities.

Categories: