Skip to content
FeedbackDashboard

Download build target output

$client->builds->targetOutputs->retrieve(string buildID, Target target, Type type, ?Output output, ?string path): TargetOutputGetResponse
GET/v0/build_target_outputs

Retrieve a method to download an output for a given build target.

If the requested type of output is source, and the requested output method is url, a download link to a tarball of the source files is returned. If the requested output method is git, a Git remote, ref, and access token (if necessary) is returned.

Otherwise, the possible types of outputs are specific to the requested target, and the output method must be url. See the documentation for type for more information.

ParametersExpand Collapse
buildID: string

Build ID

target: Target

SDK language target name

type: Type
output?:optional Output

Output format: url (download URL) or git (temporary access token).

path?:optional string

The path of the file to get when used with "type": "file".

ReturnsExpand Collapse
One of the following:
URL
"url" output
Target target
Type type
string url

URL for direct download

?string path

The path of the file, which is only present when using with the type "file" option.

Git
string token

Temporary GitHub access token

"git" output
string ref

Git reference (commit SHA, branch, or tag)

Target target
Type type
string url

URL to git remote

Download build target output

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'staging');

$targetOutput = $client->builds->targetOutputs->retrieve(
  buildID: 'build_id',
  target: 'node',
  type: 'source',
  output: 'url',
  path: 'path',
);

var_dump($targetOutput);
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}
Returns Examples
{
  "output": "url",
  "target": "node",
  "type": "source",
  "url": "url",
  "path": "path"
}