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.
- You can track a maximum of 1000 assets per API version or Service. If either a check-in would exceed 1000 assets in the repository or if you try to check out a project with more than 1000 assets, the API returns 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. |