Lists activities for which a booking can be created.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');
// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });
async function run() {
// Load the profile
const profile = await sdk.getProfile('booking/list-activities@1.0.0');
// Use the profile
const result = await profile
.getUseCase('ListActivities')
.perform({
page: ''
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"page": ""
}
{
"activities": [
{
"id": "ACT-1",
"name": "Fly to the moon!",
"description": "Take a flight to outer space and experience the beauty of the moon from a different perspective.",
"shortDescription": "Experience the beauty of the moon from a different perspective.",
"images": [
{
"url": "https://example.com/moon.jpg",
"thumbnailUrl": "https://example.com/moon-thumb.jpg",
"caption": "A flight to the moon."
}
],
"videos": [
{
"url": "https://example.com/moon-vid.mp4",
"thumbnailUrl": "https://example.com/moon-vid-thumb.jpg",
"caption": "A video of a flight to the moon."
}
],
"tags": [
"SPACE"
],
"customFields": [
null
]
}
]
}