Skip to content
Start here

Download command output file

client.ZeroTrust.DEX.Commands.Downloads.Get(ctx, commandID, filename, query) (*Response, error)
GET/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}

Downloads artifacts for an executed command. Bulk downloads are not supported

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloudflare DEX WriteCloudflare DEX ReadZero Trust ReportZero Trust Read
ParametersExpand Collapse
commandID string

Unique identifier for a command

filename string
query DEXCommandDownloadGetParams
AccountID param.Field[string]

unique identifier linked to an account in the API request path

maxLength32
ReturnsExpand Collapse
type DEXCommandDownloadGetResponse interface{…}

Download command output file

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  download, err := client.ZeroTrust.DEX.Commands.Downloads.Get(
    context.TODO(),
    "5758fefe-ae7e-4538-a39b-1fef6abcb909",
    "filename",
    zero_trust.DEXCommandDownloadGetParams{
      AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", download)
}
Returns Examples