Using Catchpoint's Swagger UI

Prev Next

Catchpoint’s REST API v2 is provided as a standard swagger document. This makes it easy to build calls and develop your automation with Catchpoint. Please read on to learn some tips and tricks to quickly get up and running with Catchpoint’s API:

1. Import to a REST API client

If you use any third-party API client to consume REST APIs, then you can easily import Catchpoint’s REST API v2 documentation. Copy the link from our Swagger page to import the collection.

swagger link.png

link - https://io.catchpoint.com/api/swagger/v2.0/swagger.json

2. REST API v2 Enumeration

REST API v2 provides an easy way to get all the enumeration details that might be required when creating or updating a resource. The major sections of REST API v2 include special enumeration endpoints that will fetch required details so that you can build your other calls.

enumeration.png

3. Retrieve Data from Catchpoint

Use the “GET” endpoints from the Swagger page to retrieve data from the Catchpoint Portal. The GET endpoints allow you to get a specific resource with its ID, or a data set with a dynamic query. In the Swagger Page you will see the “By ID” or “By Parameter”, after the endpoint name, indicating which type of query you can perform.

Product endpoint.png

4. Create a Resource in Catchpoint

Use the “POST” endpoints to create a resource in Catchpoint (e.g. adding a new Product to Control Center.) The POST request requires a payload to describe the resource. The resource can be created with minimal required in the Catchpoint Portal. Use this KB to understand how to form the Payload for POST request.

post product.png

5. Update a Resource in Catchpoint

Use the “PATCH” endpoints to only update the required properties of a resource. This only requires passing the properties that will be changed, and any unspecified properties will be left with their current settings. The PATCH endpoints allow operations such as add, remove and replace existing resource properties. This operation needs to be passed in the request payload. Note that required properties cannot be removed. To learn more about PATCH endpoint use this KB.

patch product.png

6. Delete a Resource in Catchpoint

Use the “DELETE” endpoints to remove a resource. Note that the API will not ask for confirmation for resource deletion and once the resource is deleted it cannot be restored.

delete test.png

7. Parameters in REST API v2

Different endpoints support/require different parameters. The parameters list for each endpoint can be easily accessed from the Swagger page by expanding the indvidual endpoint.

parameters.png

8. Understanding Request Structure

The POST and PATCH endpoints require you to pass along a payload describing the resource to be created/updated. The Swagger UI provides examples and Schema for endpoints that require this. This will be useful to understand each request structure.

request structure.png

9. Understanding Response Structure

Each endpoint provides a response to indicate success or failure. The Swagger UI has an example and schema for each endpoint's response. This will be useful to understand each response structure.

response structure.png

10. Use versioning

The REST API v2 supports versioning to roll out new features to the API without breaking any automation scripts. Use this dropdown to choose the available versions.

versioning.png