Skip to content
  • Auto
  • Light
  • Dark
Get Started

Retrieve

Retrieve
client.vals.branches.retrieve(stringvalId, stringbranchId, RequestOptionsoptions?): idstringcreatedAtstringforkedBranchIdunionlinksLinksnamestringupdatedAtstringversionnumberBranchRetrieveResponse
get/v2/vals/{val_id}/branches/{branch_id}

Get a branch by id

Parameters
valIdstring
formatuuid
branchIdstring
formatuuid
Returns
BranchRetrieveResponse

A Branch

Hide ParametersShow Parameters
idstring

The id of the branch

formatuuid
createdAtstring
formatdate-time
forkedBranchIdunion
string | null

The id of the branch this branch was forked from

namestring
updatedAtstring
formatdate-time
versionnumber
minimum0
import ValTown from '@valtown/sdk';

const client = new ValTown();

const branch = await client.vals.branches.retrieve(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(branch.id);
200 Example
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "forkedBranchId": "forkedBranchId",
  "links": {
    "html": "https://example.com",
    "self": "https://example.com"
  },
  "name": "name",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "version": 0
}