Netless

Netless

  • JavaScript
  • Android
  • iOS
  • Server
  • FAQ
  • GitHub
  • 🇨🇳 中文

›Server API

Overview

  • Introduction

Server API

  • Request specification
  • Whiteboard basics API
  • Get cover API
  • Scene management API
  • Document to Picture
  • Document to Web Page
  • Postman configuration file

Get cover API

Get cover is a service that converts whiteboard scenes into pictures. Whiteboard scenes can be used to implement functions such as thumbnails and room covers after being converted into pictures.

For more information about scenes, please refer to: Scene Management

Ready to work

1. According to the Configure Cloud Storage article, configure cloud storage in console

2. Open the Get Cover service on the management console

  1. Go to console, and click to enter the application management page in the list on the left .

  2. Find Get Cover to activate

Click to expand: operation diagram in console

  • Get initial status of cover service Get initial status of cover service

  • Get cover service management page Get cover service management page

  • Get cover service off Get cover service off

Specific scene cover

POST /handle/rooms/single-snapshot

  • header parameter
FieldTypeDescription
roomTokenstring{{roomtoken}}
  • body parameter
FieldTypeDescription
widthnumberCover width(px)
heightnumberCover Height(px)
uuidstringWhiteboard unique identifier
scenePath(optional)stringNeed to read the scene path of the cover (if not passed, return the cover picture of the current scene)

Note: This interface can only use room token

  • body example
{
  "width": 240,
  "height": 180,
  "scenePath": "/init",
  "uuid": "xxxxxx4e96db4e6cb1ce492157xxxxxx"
}
  • response
{
     "code": 200,
    "msg": {
        "image": {
            "url": "url",   // Cover image url
            "key": "key", // The key for the cover image stored in the storage service
            "bucket": "bucket", // Cover image stored in bucket in storage service
            "region": "region"  // Regions where the cover image is stored in the storage service
        }
    }
}

Cover in scope

POST /handle/rooms/snapshots

  • header parameter
FieldTypeDescription
roomTokenstring{{roomtoken}}
  • body parameter
FieldTypeDescription
widthnumberCover width (px)
heightnumberCover height (px)
uuidstringWhiteboard unique identifier
page (可选)numberReturn value for pagination (default is 1)
size(可选)numberReturns the number of scene screenshots returned on each page of the list (default is 5, maximum is 10)
scenePathstringScene group path
  • body example
{
    "width": 400,
    "height": 400,
    "uuid": "xxxxxx4e96db4e6cb1ce492157xxxxxx",
    "scenePath": "/",
    "page":1,
    "size": 1
}

The instructions on pagination are as follows:

The number of scene screenshots requested by the user at one time is limited. The background page paginates the scene list under the specified scene group and returns the data corresponding to page and size entered by the user. Each page returns up to 10 pieces of data.

About the scene path:

Suppose the user has a list of scenarios

  • /physics/quantum-mechanics/first-chapter
  • /physics/newtonian-mechanics
  • /english

Then after the user passes scenePath = "/ physics", the interface will only return

  • /physics/newtonian-mechanics
  • /physics/relativity-theory

The two screenshot data, again, the interface will only return after the user passes scenePath = "/"

  • /english

Screenshot data

  • response
{
    "code": 200,
    "msg": [
        {
            "url": "url1",
            "key": "key1",
            "bucket": "bucket",
            "region": "region"
        },
        {
            "url": "url2",
            "key": "key2",
            "bucket": "bucket",
            "region": "region"
        }
    ]
}

Note: This interface can only input room token

Last updated on 8/25/2020 by az
← Whiteboard basics APIScene management API →
  • Ready to work
    • 1. According to the Configure Cloud Storage article, configure cloud storage in console
    • 2. Open the Get Cover service on the management console
  • Specific scene cover
  • Cover in scope
Netless
Let's interactive.
Product
ConsoleHomepageDemoGithub
Company
Join usServicePrivacy
Contact
support@netless.linkCommunity
Copyright © 2020 Netless