All Products
Search
Document Center

Recommend

Last Updated: Apr 01, 2021

Description

Queries the recommendation results of a specified instance.

Method

GET

URI

/openapi/instances/{instanceId}/actions/recommend

Request parameters

Parameter

Type

Required

Description

sceneId

String

Yes

The ID of the scene.

userId

String

No

The unique ID of the user.

ip

String

No

The last logon IP address of the user.

imei

String

No

1. This parameter is required for users who do not have an account. 2. If information such as the MAC address or device number is invalid, the internal user persona information cannot be used. Only the recommendation blocking feature can be used. 3. The value of this parameter is a 32-bit MD5 value. 4. If the Android operating system is used, this parameter is set to an IMEI value generated by using the MD5 message-digest algorithm. If the iOS operating system is used, this parameter is set to an IDFA value generated by using the MD5 message-digest algorithm.

ReturnCount

Integer

Yes

The number of result entries to return. Valid values: 0 to 50.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request. This parameter is a common parameter.

Result

List

The list of result items.

Result items

Parameter

Type

Description

traceId

String

traceId=traceInfo: These two parameters are used for returning logs. During the process, trace_id is set to ali and trace_info is set to the value of the traceInfo parameter that is specified in the response. Note that values of trace_id and trace_info vary for different items.

itemId

String

The ID of the item.

itemType

String

The type of the item.

matchInfo

String

This parameter may be used in the debugging process. You can ignore this parameter.

weight

Float

This parameter may be used in the debugging process. You can ignore this parameter.

position

Integer

The position at which items are displayed. The position number starts from 0. Note that the return result is sorted by position. You can ignore this parameter.

traceInfo

String

traceInfo=traceId

Sample requests

GET /openapi/instances/airec-cn-dsksdlisdlfsd/actions/recommend
? sceneId=1&userId=2&ip=10.120.70.19&returnCount=10

Sample responses

{
  "requestId": "04707E49-642A-4649-827A-F8EEB07D4C27",
  "result": [
    {
      "traceId": "1007.19746.107647.100200300000000:c7bd13e3-371b-4276-b142-4c1a439f21a0:1:40000:0::::2:content___1729346806:image:cd:0.0545865490313237:0.027317269681932512:0.6218346196125295:::::::::::",
      "itemId": 1729346806,
      "itemType": "image",
      "matchInfo": "cd",
      "weight": 1.2,
      "position": 0,
      "traceInfo": ""      
    },
    {
      "traceId": "1007.19746.107647.100200300000000:c7bd13e3-371b-4276-b142-4c1a439f21a0:1:40000:0::::2:content___1729346806:image:cd:0.0545865490313237:0.027317269681932512:0.6218346196125295:::::::::::",
      "itemId": 1729346806,
      "itemType": "image",
      "matchInfo": "cd",
      "weight": 1.0,
      "position": 0,
      "traceInfo": ""
    }
  ]
}