Retrieve
client.alias.username.valName.retrieve(stringvalName, ValNameRetrieveParams { username } params, RequestOptionsoptions?): Val { id, author, createdAt, 5 more }
/v2/alias/vals/{username}/{val_name}
Get a val
Parameters
valName: string
Returns
import ValTown from "npm:@valtown/sdk";
const client = new ValTown();
const val = await client.alias.username.valName.retrieve('val_name', { username: 'username' });
console.log(val.id);
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"author": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"type": "user",
"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"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"author": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"type": "user",
"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"
}