Chilkat Online Tools

Go / Anypoint Platform APIs / Export api as ZIP

Back to Collection Items

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

    http := chilkat.NewHttp()
    var success bool

    queryParams := chilkat.NewJsonObject()
    queryParams.UpdateString("endpoint","true")
    queryParams.UpdateString("slaTiers","true")
    queryParams.UpdateString("cookie","file-download-1619013965103")

    // Adds the "Authorization: Bearer {{token}}" header.
    http.SetAuthToken("{{token}}")

    resp := http.QuickRequestParams("GET","https://domain.com/apimanager/api/v1/organizations/{{organization_id}}/environments/{{environment_id}}/apis/{{api_Id}}/bundle",queryParams)
    if http.LastMethodSuccess() == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        queryParams.DisposeJsonObject()
        return
    }

    fmt.Println(resp.StatusCode())
    fmt.Println(resp.BodyStr())
    resp.DisposeHttpResponse()

    http.DisposeHttp()
    queryParams.DisposeJsonObject()

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": [
  ]
}