Skip to content
  • Auto
  • Light
  • Dark
Get Started

Retrieve

Retrieve
client.vals.retrieve(stringvalId, RequestOptionsoptions?): idstringauthorAuthorcreatedAtstringdescriptionunionimageUrlunionlinksLinksnamestringprivacyunionVal
get/v2/vals/{val_id}

Get a val by id

Parameters
valIdstring
formatuuid
Returns
idstringauthorAuthorcreatedAtstringdescriptionunionimageUrlunionlinksLinksnamestringprivacyunionVal
import ValTown from '@valtown/sdk';

const client = new ValTown();

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

console.log(val.id);
200 Example
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "author": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "username": "username"
  },
  "createdAt": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "imageUrl": "imageUrl",
  "links": {
    "html": "https://example.com",
    "self": "https://example.com"
  },
  "name": "name",
  "privacy": "public"
}