Help Center> RES> API Reference> API> Scenario> Updating a Custom Scenario

Updating a Custom Scenario

Function

This API is used to update the content of a custom scenario.

URI

PUT /v2.0/{project_id}/workspaces/{workspace_id}/scenes/{scene_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

scene_id

Yes

String

Scenario ID

workspace_id

Yes

String

Workspace ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Content type. The value is application/json.

X-Auth-Token

Yes

String

User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

category

Yes

String

Scenario type. The options are:

  • customize: custom recommendation scenario

  • popularity: popularity-based recommendations

  • relation: associated item recommendations

  • personalization: recommendations based on the prediction on what you may also like

datasource_id

Yes

String

Data source ID, which is a string of 32 characters and contains letters, digits, underscores (_), and hyphens (-)

ds_config

Yes

ds_config object

Data source settings

scene_name

Yes

String

Scenario name, which is a string of 1 to 64 characters and contains letters, digits, underscores (_), and hyphens (-)

Minimum: 1

Maximum: 64

specs_config

Yes

SpecsConfig object

Computing specifications

type

Yes

String

Scenario type. The options are:

  • UI: recommending items based on users

  • UU: recommending users based on users

  • II: recommending items based on items

  • IU: recommending users based on items

service_type

Yes

String

Service type. The options are:

  • rank: ranking service

  • rec: recommendation service

Table 4 ds_config

Parameter

Mandatory

Type

Description

time_interval

No

Integer

Time range for selecting data (days)

category_type

No

String

Item type

Table 5 SpecsConfig

Parameter

Mandatory

Type

Description

offline

Yes

String

Offline computing specifications

nearline

No

String

Real-time computing specifications

rank

No

String

Deep learning computing specifications

online_tps

No

Integer

Max. number of concurrent online services

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

message

String

Response message (This field is not returned when the request is successful.)

error_code

String

Error code (This parameter is not returned when the request is successful.)

Example Requests

This API is used to update the scenario content.

/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/scenes/testuuidxxxxxxxxxxxxxxxxxxxxxxxx

{
  "scene_name" : "jby-test-0227-4",
  "category" : "customize",
  "type" : "UI",
  "service_type" : "rank",
  "datasource_id" : "6a3475a7dd11492e8d14f73a3719333b",
  "ds_config" : {
    "time_interval" : 30
  },
  "specs_config" : {
    "offline" : "4CU",
    "nearline" : "2CU",
    "rank" : "8CU",
    "online_tps" : 10
  }
}

Example Responses

Status code: 200

OK

{
  "is_success" : "true"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.