Chilkat Online Tools

Swift / Anypoint Platform APIs / Export api as ZIP

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()
    var success: Bool

    let queryParams = CkoJsonObject()
    queryParams.UpdateString("endpoint", value: "true")
    queryParams.UpdateString("slaTiers", value: "true")
    queryParams.UpdateString("cookie", value: "file-download-1619013965103")

    // Adds the "Authorization: Bearer {{token}}" header.
    http.AuthToken = "{{token}}"

    var resp: CkoHttpResponse? = http.QuickRequestParams("GET", url: "https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}/bundle", json: queryParams)
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    print("\(resp!.StatusCode.intValue)")
    print("\(resp!.BodyStr)")
    resp = nil

}

Curl Command

curl -G -d "endpoint=true"
	-d "slaTiers=true"
	-d "cookie=file-download-1619013965103"
	-H "Authorization: Bearer {{token}}"
https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}/bundle

Postman Collection Item JSON

{
  "name": "Export api as ZIP",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer {{token}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}/bundle?endpoint=true&slaTiers=true&cookie=file-download-1619013965103",
      "host": [
        "{{url}}"
      ],
      "path": [
        "apimanager",
        "api",
        "v1",
        "organizations",
        "{{organization_id}}",
        "environments",
        "{{environment_id}}",
        "apis",
        "{{api_Id}}",
        "bundle"
      ],
      "query": [
        {
          "key": "endpoint",
          "value": "true"
        },
        {
          "key": "slaTiers",
          "value": "true"
        },
        {
          "key": "cookie",
          "value": "file-download-1619013965103"
        }
      ]
    }
  },
  "response": [
  ]
}