Checkout API version from Git

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

Overview

Check out the specified Git branch for the specified Classic API version or APIM 3.0 Service. Equivalent to git checkout.

Note:
  • The API version or Service must exist.
  • The Git Integration counts files separately for the Service folder, each version folder, and each endpoint folder, and tracks up to 1,000 files in each. The count includes every tracked asset, because each asset is stored as one file, plus the metadata file in the folder and any other files the folder holds in the repository. Each file can be up to 50 MB. An operation that exceeds either limit fails with an error.

Prerequisites

  • Write access to the assets to be added or updated

Limitations

  • You can't use SnapLogic service accounts to call any of the SnapLogic API Management Git operation APIs.

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/checkout/acme/apim/BookStore/1.0' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json' \
  -d '{
  "branch_name": "main"
}'

Response

 {
  "response_map": {
    "status": "",
    "overwritten": [ ... ],
    "updated": [ ... ],
    "error_msgs": [ ... ],
    "created": [ ... ],
    "ignored": [ ... ]
  },
  "http_status_code": 200
}
Key Type Description
status string The status of the checkout operation.
overwritten array The list of files that were overwritten in the SnapLogic specified project.
ignored array Asset files that exist in the Git repository but weren't copied into the project.
updated array Files updated in the SnapLogic project.
created array Asset files copied from the Git repository into the project.
error_msgs array/string Error messages from the checkout operation.

Error handling

HTTP status codes Message Resolution
400 Org not found for the user Verify the Org name in the API version path is correct.
401 Unauthorized Verify your credentials and permissions.