# Swagger

Swagger is an Open Source tool that allows design, description and testing on the first open source editor fully dedicated to OpenAPI-based APIs. The Swagger Editor is an easy way to get started with the OpenAPI Specification (formerly known as Swagger), with support for Swagger 2.0 and OpenAPI 3.0.

The Editor works in any development environment, be it locally or in the web.

The full specification of the api call and definitions can be found on the following link. https://app2.kpro.co/hp-api/swagger/index.html

This allows you to see the calls and responses.

Once you have your api token you will also be able to login into the api to test the endpoints.

image

# Instant Visualization

Swagger allows us to render the API specification visually and interact with it through a UI

If we take the endpoint /hp-api/v1/get-application-archive/{applicationId}​ as an example; it can be found under the Application section of the api:

To see the endpoint working click on the GET button and you are then shown the exepcted response and an ability to try the endpoint out.

Example Value

{
  "fileContentBase64": "string",
  "fileName": "string"
}

With authorisaztion set and the Execute button pressed swagger will make the call to the api and the reponse given will show an example Curl

e.g.

curl -X GET "https://app2.kpro.co/hp-api/v1/get-application-archive/2456'" -H "accept: application/json" -H "Authorization: xxxxxxxxxL00LJeHMg0FW2sFxxxxxxWdaD7Guc14GwlmPXxxxxxxxE"

Under this example it will then show the Reponse body and return code

{
  "fileContentBase64": "3uHHHww66dfff",
  "fileName": "Archive 28th Aug.zip",
}