Pull latest changes from Git

POST https://{controlplane_path}/api/1/rest/public/apim/pull/{path_to_apiversion_or_service}      
Important: This API works for both Classic and APIM 3.0 assets.

Overview

Update the Classic API version or APIM 3.0 Service with the latest files from the associated Git repository. Equivalent to git pull.

Note:
  • 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/pull/acme/apim/BookStore/1.0' \
  -H 'Authorization: Basic {base64_encoded email:password}' \
  -H 'Content-Type: application/json'

Response


 {
    "response_map": {
        "status": "updated",
        "overwritten": [],
        "ignored": [],
        "updated": [
            "file.txt",
            "file1.txt"
        ],
        "created": [
            "addme.txt"
        ],
        "error_msgs": []
    },
    "http_status_code": 200
}

{
    "response_map": {
        "status": "up-to-date"
    },
    "http_status_code": 200
}
Key Type Description
status string The status of the pull operation.
overwritten array Files overwritten in the SnapLogic project.
ignored array Asset files in the Git repository that the operation skipped.
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 pull operation.
up-to-date string Returned when the branch is already up to date.

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.