Importing requests

Restlet Client helps you discover your APIs by defining, saving and running requests. Editing requests by hand is fine to discover the tool and make your first steps in the product, but you probably have a complete API you would like to request and creating the requests for all its resources would be a fastidious, error-prone task.

We want to make sure Restlet Client helps you in your everyday life and stays a modern and open tool. That's why we've made sure it can import different standard formats like Swagger - the reference in API documentation - and HAR.

This means that you can request any API that exposes its Swagger really easily and you can convert you browser's navigation history in ready-to-launch Restlet Client requests.

We distinguish two kinds of data to import:

The rest of this section focuses on the specificities of each import.

Import API contracts

From Restlet Studio

Restlet Studio is a module of the Restlet Platform that enable teams to design and document their API contract. Restlet Platform offers a built-in integration from Restlet Studio to Restlet Client in order to quickly interact with an API being built. The imported contract can also be very useful to bootstrap API tests from an existing contract.

Learn more about this Restlet Platform integration.

Swagger 2.0

The specification of the Swagger 2.0 format is available here .

Only JSON is supported at the moment, in case you only have a YAML document, you can easily convert it to JSON before importing it in Restlet Client. Online converters flourish on the web, you can try this one for example.

Swagger 2.0 is available under two formats: JSON and YAML. Only the former format is supported right now.

The whole Swagger description is imported into a new project. Here is a description of the items created at import.

Swagger item Corresponding Restlet Client item Comments
API Project A project containing all the converted Swagger. Its name and description are the Swagger API title and description
Path Service Each path in Swagger is converted to a service. The service is named after the base path of the Swagger Path.
Operation Request All the operations of a Swagger path are converted to requests and located inside the service extracted from the said path.

Import definition of requests

Postman

We estimate that Postman and Restlet Client are both valuable tools that deserve your attention. We provide the ability to import Postman collections (V2.0) into Restlet Client in order to help users of Postman try out Restlet Client with the data they are familiar with.

Postman item Corresponding Restlet Client item Comments
root folder root project Single project, which name is given by the name of the root folder in the collection. A suffix is added in order to prevent name collisions.
sub folders services As POSTman supports infinite folder depth - which Restlet Client does not - subfolders are flattened.
requests requests Environment variables are imported too (the environment holds the name of the project), but they are valuated. When possible, some assertions are generated too after parsing the Postman scripts.

You can refer to this blog post for more details about the import rules.

HAR 1.2

HAR is a JSON-based format able to describe HTTP requests and responses. Major Web browsers support to export all interactions in this format. Requests are imported into a root scenario, which name is the date of the import - in ISO 8601 format . The main reason to use a scenario, and not a project as the other kind of import, is that a HAR log is an ordered sequence of HTTP requests/responses, so does a scenario in Restlet Client. Learn more in the dedicated tutorial: Build an API test for your Web application

Restlet Client repository

You can export your own local repository into a JSON-based format file. Then import it into Client again. You are assured that the imported entities are exactly the same than the one exported.

Import policies

When importing a Restlet Client repository, you can choose between three different policies:

  • Update Any element that does not exist in your drive - equality is checked by name - is imported. For elements that already exist, the newest is kept between the imported and the current one based on the date of last edition.

  • Overwrite Imports new elements and overwrites existing ones.

  • Preserve Imports new elements and ignores existing ones.

Please note that none of these policies delete anything in your drive