# Target Outputs ## 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. ### Parameters - `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". ### Returns - `TargetOutputGetResponse` - `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 ### Example ```php builds->targetOutputs->retrieve( buildID: 'build_id', target: 'node', type: 'source', output: 'url', path: 'path', ); var_dump($targetOutput); ``` #### Response ```json { "output": "url", "target": "node", "type": "source", "url": "url", "path": "path" } ```