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
Configure Cloud Storage article, configure cloud storage in console
1. According to the2. Open the Get Cover service on the management console
Go to console, and click to enter the application management page in the list on the left .
Find
Get Cover
to activate
Click to expand: operation diagram in console
Get initial status of cover service
Get cover service management page
Get cover service off
Specific scene cover
POST /handle/rooms/single-snapshot
- header parameter
Field | Type | Description |
---|---|---|
roomToken | string | {{roomtoken}} |
- body parameter
Field | Type | Description |
---|---|---|
width | number | Cover width(px) |
height | number | Cover Height(px) |
uuid | string | Whiteboard unique identifier |
scenePath(optional) | string | Need 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
Field | Type | Description |
---|---|---|
roomToken | string | {{roomtoken}} |
- body parameter
Field | Type | Description |
---|---|---|
width | number | Cover width (px) |
height | number | Cover height (px) |
uuid | string | Whiteboard unique identifier |
page (可选) | number | Return value for pagination (default is 1) |
size(可选) | number | Returns the number of scene screenshots returned on each page of the list (default is 5, maximum is 10) |
scenePath | string | Scene 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