Skip to main content
Android
iOS
Web

Screenshots

The screenshot-management feature is implemented by Interactive Whiteboard. You can take screenshots for a single scene or a scene directory, generate images in PNG format, and upload them to a third-party cloud storage space.

Before calling the RESTful API for screen management, ensure that:

Screenshot a scene (POST)

Call this API to take screenshots for a single scene.

Prototype

  • Method: POST
  • Access point: https://api.netless.link/v5/rooms/{uuid}/screenshots

Request header

Pass in the following parameters in the request header:

ParameterData typeRequired/OptionalDescription
tokenstringRequiredAn SDK token or room token with the writer or admin role. To get an SDK token, you can:
  • Get a test-purpose SDK token from Agora Console. See Get security credentials for your whiteboard project.
  • Call the RESTful API. See Generate a room token.
  • Use code samples. See Generate a token from your app server.
  • To get a room token, you can:
  • Call the RESTful API. See Generate a room token.
  • Use code samples. See Generate a token from your app server.
  • regionstringRequiredSpecifies a data center to process the request:
  • us-sv: Silicon Valley, US, which provides services to North America and South America.
  • sg: Singapore, which provides services to Singapore, East Asia, and Southeast Asia.
  • in-mum: Mumbai, India, which provides services to India.
  • eu: Frankfurt, Europe, which provides services to Europe.
  • cn-hz: Hangzhou, China, which provides services to the areas not covered by other data centers.
  • Request path

    The following parameters are required in the URL:

    ParameterData typeRequired/OptionalDescription
    uuidstringRequiredThe room UUID, which is the unique identifier of a room. You can get it by calling the RESTful API to create a room or calling the RESTful API to get room information.

    Request body

    ParameterData typeRequired/OptionalDescription
    widthnumberRequiredThe width of the screenshot in pixels.
    heightnumberRequiredThe height of the screenshot in pixels.
    pathstringOptionalThe path to the scene, which starts with /. If you do not set this parameter, the default path /init is used.

    Request example


    _10
    POST /v5/rooms/a7e04xxxxx7d1eca69/screenshots
    _10
    Host: api.netless.link
    _10
    region: us-sv
    _10
    Content-Type: application/json
    _10
    token: NETLESSSDK_YWs9xxxxxxzA5ZGM2MjRi
    _10
    _10
    {
    _10
    "width": 640,
    _10
    "height": 480
    _10
    }

    HTTP response

    For details about all possible response status codes, see the status code table.

    If the status code is 201, the request is successful. The response returns the status code and corresponding parameters.

    The following is a response example for a successful request:


    _8
    "status": 201,
    _8
    "body":
    _8
    {
    _8
    "url": "https://white-cover.oss-cn-hangzhou.aliyuncs.com/room_cover/2811/a7exxxxca69undefined.png",
    _8
    "key": "room_cover/2811/a7exxxxxca69undefined.png",
    _8
    "bucket": "white-cover",
    _8
    "region": "oss-cn-hangzhou"
    _8
    }

    Description of parameters in the response:

    ParameterData typeDescription
    urlstringThe URL of the screenshot.
    keystringThe filename of the screenshot in the storage space.
    bucketstringThe name of the storage space where the screenshot is saved.
    regionstringThe region where the storage space is located.

    If the status code is not 201, the request fails. The response body includes a message field that describes the reason for the failure.

    Screenshot a scene directory (POST)

    Call this API to take screenshots for a scene directory.

    Prototype

    • Method: POST
    • Access point: https://api.netless.link/v5/rooms/{uuid}/screenshot-list

    Request header

    Pass in the following parameters in the request header:

    ParameterData typeRequired/OptionalDescription
    tokenstringRequiredAn SDK token or room token with the writer or admin role. To get an SDK token, you can:
  • Get a test-purpose SDK token from Agora Console. See Get security credentials for your whiteboard project.
  • Call the RESTful API. See Generate an SDK token.
  • Use code samples. See Generate a token from your app server.
  • To get a room token, you can:
  • Call the RESTful API. See Generate a room token.
  • Use code samples. See Generate a token from your app server.
  • regionstringRequiredSpecifies a data center to process the request:
  • us-sv: Silicon Valley, US, which provides services to North America and South America.
  • sg: Singapore, which provides services to Singapore, East Asia, and Southeast Asia.
  • in-mum: Mumbai, India, which provides services to India.
  • eu: Frankfurt, Europe, which provides services to Europe.
  • cn-hz: Hangzhou, China, which provides services to the areas not covered by other data centers.
  • Request path

    The following parameters are required in the URL:

    ParameterData typeRequired/OptionalDescription
    uuidstringRequiredThe room UUID, which is the unique identifier of a room. You can get it by calling the RESTful API to create a room or calling the RESTful API to get room information.

    Request body

    ParameterData typeRequired/OptionalDescription
    widthnumberRequiredThe width of the screenshot in pixels.
    heightnumberRequiredThe height of the screenshot in pixels.
    pathstringRequiredThe path to the scene directory, which starts with /. If you do not set this parameter , the current scene directory is used.

    Request example


    _11
    POST /v5/rooms/faed3130727911ebaea37759ee91947c/screenshot-list
    _11
    Host: api.netless.link
    _11
    region: us-sv
    _11
    token: NETLESSSDK_YWsxxxxxxYjc0
    _11
    Content-Type: application/json
    _11
    _11
    {
    _11
    "width": 640,
    _11
    "height": 480,
    _11
    "path": "/test"
    _11
    }

    HTTP response

    For details about all possible response status codes, see the status code table.

    If the status code is 201, the request is successful. The response returns the status code and corresponding parameters.

    The following is a response example for a successful request:


    _16
    "status": 201,
    _16
    "body":
    _16
    [
    _16
    {
    _16
    "url": "https://docs-test-xxx.oss-cn-hangzhou.aliyuncs.com/room_cover/2811/faxxxxx47c/test/cover.png",
    _16
    "key": "room_cover/2811/faxxxxx47c/test/cover.png",
    _16
    "bucket": "docs-test-xxx",
    _16
    "region": "oss-cn-hangzhou"
    _16
    },
    _16
    {
    _16
    "url": "https://docs-test-xxx.oss-cn-hangzhou.aliyuncs.com/room_cover/2811/faxxxxx47c/test/page1.png",
    _16
    "key": "room_cover/2811/faxxxxx47c/test/page1.png",
    _16
    "bucket": "docs-test-xxx",
    _16
    "region": "oss-cn-hangzhou"
    _16
    }
    _16
    ]

    The response body is an array of the screenshot information for each scene. Every member in the array contains the following parameters:

    ParameterData typeDescription
    urlstringThe URL of the screenshot.
    keystringThe filename of the screenshot in the storage space.
    bucketstringThe name of the storage space where the screenshot is saved.
    regionstringThe region where the storage space is located.

    If the status code is not 201, the request fails. The response body includes a message field that describes the reason for the failure.

    vundefined