Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

API-Collections

Number of APIs: 3


1. Get a collection

GET {{baseUrl}}/apis/{{apiId}}/collections/{{collectionId}}

Gets a collection attached to an API. You can use the versionId query parameter to get a collection published in a version.

Note:

The versionId query parameter is a required parameter for API viewers.



2. Add a collection

POST {{baseUrl}}/apis/{{apiId}}/collections

Adds a collection to an API. To do this, use the following operationType values:

  • COPY_COLLECTION — Copies a collection from the workspace and adds it to an API.
  • CREATE_NEW — Creates a new collection by providing the new collection's content.
  • GENERATE_FROM_SCHEMA — Generates the collection from an API schema.

For examples of each method, see the collection's response examples.



3. Sync collection with schema

PUT {{baseUrl}}/apis/{{apiId}}/collections/{{collectionId}}/sync-with-schema-tasks

Syncs a collection attached to an API with the API schema. This is an asynchronous endpoint that returns an HTTP 202 Accepted response.

The response contains a polling link to the /apis/{apiId}/tasks/{taskId} endpoint in the Location header.

Note:

This endpoint only supports the OpenAPI 3 schema type.



ENDPOINTS