Publish a set of API versions

POST https://{controlplane_path}/api/1/rest/public/apim/publish_versions      

Publish the specified set of API versions.

Important: This page describes a Classic APIM API.

Prerequisites

  • Environment (Org) admin permissions

Request header

Use the application/json content type with basic authentication (email and password) or a JWT. For examples, refer to Authentication.

Example

This example uses Basic authentication. For a JWT example, refer to Authentication.

curl -X 'POST' \
  'https://elastic.snaplogic.com/api/1/rest/public/apim/publish_versions' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json' \
  -d '{
  "org_name": "acme",
  "versions_info": [
    "/acme/apim/BookStore/1.0"
  ]
}'

Response

{
    "response_map": {
        "successful_versions": [
            "/docteamorg/apim/MyAPI/1.0"
        ],
        "unsuccessful_versions": [
            {
                "/docteamorg/apim/MyAPI/2.0": "Problem publishing API Specification: Invalid API specification"
            }
        ]
    },
    "http_status_code": 200
}
Key Type Description
successful_versions array List of API version paths that were successfully published.
unsuccessful_versions array List of API version paths that failed to publish, with error messages.

Error handling

HTTP status codes Message Resolution
400 May not have Read permission for org: {org_name} Verify you have Org admin permissions.
401 Unauthorized Verify your credentials and that you have Org admin permissions.