0

I want to use predict method in order to get recommendation devided by page. This method has pageToken parameter used for paging. The parameter should be received in the previous prediction response. But this method in v2 API doesn't return pageToken or nextPageToken that is in v1beta1 API. Why it disappeared? How can I get next page for prediction?

Request url is https://retail.googleapis.com/v2/projects/{PROJECT_NUMBER}/locations/global/catalogs/default_catalog/placements/recently_viewed_default:predict

Request body is

{
  "filter": "tag=(\"成人作品\") filterOutOfStockItems",
  "userEvent": {
    "eventType": "home-page-view",
    "visitorId": "1254704470.1607003607",
    "productDetails": [
      {
        "product": {
          "id": "220604"
        },
        "quantity": 1
      }
    ]
  }
}

The response is here. There is no nextPageToken

{
  "results": [
    {
      "id": "170706"
    },
    {
      "id": "64081"
    },
          :
       (snip)
          :
    {
      "id": "132940"
    },
    {
      "id": "17557"
    }
  ],
  "attributionToken": "ChQxNzkzOTg1NDI3MTk1OTMyNzU0MhACGiNvZnRlbl9wdXJjX2ZyZXF1ZW50bHlfMTYxNDMwNjk3OTQyNSIYb2Z0ZW5fcHVyY2hhc2VkX3RvZ2V0aGVyKAA"
}
  • Edit your question and show the request and response. – John Hanley Mar 02 '21 at 21:42
  • Can you share the request composition as was previously asked? – Nick_Kh Mar 03 '21 at 08:02
  • I add request and response. I decided not to use pagenation in API, but I'm still curious about it . Please answer if you have any time. Thank you. – koki hashimoto Mar 06 '21 at 01:53
  • It seems this affects either v2 or v2beta APIs. If you want this feature back, file a feature request via [issue tracker](https://cloud.google.com/support/docs/issue-trackers)? Does it sound reasonable for you? – Nick_Kh Mar 10 '21 at 08:32

0 Answers0