Superface

List Activities

booking/list-activities@1.0.0
1 provider

List Activities

Lists activities for which a booking can be created.

Input
Page
Result
Activities
Next Page
Total count

1.Choose a provider

2.Use ListActivities with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
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();

Structure details

Input (object)

page
Pagination cursor (obtained from `nextPage`).

Example

{
  "page": ""
}

Result (object)

activities
A list of available activities. May be incomplete, check `nextPage` and repeat the request if necessary.
id
Unique identifier of the activity.
name
Name of the activity.
description
Full description of the activity.
shortDescription
May contain the abridged version of the description of the activity, or a different short summary.
images
Images pertaining to the activity.
url
URL of the image.
thumbnailUrl
URL of the thumbnail of the image.
caption
Optional caption of the image.
videos
Videos pertaining to the activity.
url
URL of the video.
thumbnailUrl
URL of the thumbnail of the video.
caption
Optional caption of the video.
tags
Provider-specific tags describing the activity. (e.g. SPORT, FAMILY_FRIENDLY, BUS_TOUR, etc.)
customFields
Provider-specific fields relating to the activity.
key
Key of the field.
value
Value of the field.
nextPage
Cursor of the next page of the listing.
total
Number of activities in total.

Example

{
  "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
      ]
    }
  ]
}

Implementation details

Provider
mock
Use case
ListActivities
Author
@superface
Source
Verified