All Products
Search
Document Center

CreateScene

Last Updated: Mar 29, 2021

If you need to use the scene management feature, you can log on to the AIRec console to use this feature. For more information, see Create a recommendation scene by configuring item selection rules. We recommend that you do not call API operations to use the scene management feature.

Description

Creates a scene and verifies the information that you specified for creating the scene.

Method

POST

URI

openapi/instances/{instanceId}/scenes

Request parameters

Parameter

Type

Required

Description

dryRun

Boolean

No

Specifies whether to verify the scene ID. Valid values: true and false. Default value: false. If you set the value to true, the system verifies the scene ID that you specified. If you set the value to false, the system creates a scene without verifying the scene ID that you specified.

sceneId

String

Yes

The ID of the scene.

sceneMeta

Map

Yes

The information of the scene.

└sceneName

String

Yes

The name of the scene.

└description

String

No

The description of the scene.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request.

Result

Map

The result that is returned.

└SceneId

String

The ID of the scene.

Examples

Sample requests

POST openapi/instances/{instanceId}/scenes? dryRun=false
{
    "sceneId":"123",
    "sceneMeta":{
        "sceneName":"sceneTest",
        "description":"xxx"
    }
}

Sample success responses

JSON format

{
    "RequestId":"8F81A922-6C81-46D6-B78C-CC35E16B1691",
    "Result":{
        "SceneId": "xxxxx"
    }
}

Sample error responses

JSON format

{
  "Code":"InternalServerError",
    "Message":"An internal server error occurred.",
    "RequestId":"829F38F6-E2D6-4109-90A6-888160BD16C2"
}