Aloha!我是少女人妻 Uerica!這個週末朋友要求婚了~朋友前陣子喝了一點然後問我婚姻的感覺是什麼?我回他你想要婚姻是什麼樣子,那就會是什麼樣子。人與人相處終究都是強迫認識自己的過程,不過結婚也好單身也好,無論什麼樣的狀態,我都還是自己啊~價值不因外在改變而改變,人生才會過得快樂呢~~
有關Curations的運用與介紹
Curations 隱藏與提升搜尋結果的內容
Curations 的翻譯是策展,其實就是專門管理搜尋結果的推廣 Promoted 與隱藏 Hidden。
認證方式為 Private API Key
curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
Listing All Curations 列出所有策展
回傳所有調整過的策展內容
page (optional) : 回傳當前頁面 current 、結果總頁數 total_pages 、結果總筆數 total_results 、每頁最大筆數限制 size (預設為25筆)
用 GET 方法,不帶參數回傳所有策展結果
curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''
Listing All Curations with Pagination
指定回傳的頁數與筆數
curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
"page": {
"size": 20,
"current": 2
}
}'
Listing a Single Curation
回傳指定id的策展資料
用 GET 方法,帶入id不需參數,回傳指定的策展資料
curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''
用 POST 創建新策展
curl -X POST '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
"queries": [
"banana", "bananana", "bonana", "nanner"
],
"promoted": [
"doc-123", "doc-234", "doc-345"
],
"hidden": [
"doc-987", "doc-a8b7c6", "doc-765"
]
}'
範例回傳結果
{
"id": "cur-a1b2c3"
}
用 PUT 更新策展資訊
curl -X PUT '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
"queries": [
"banana", "bananza", "bananas", "bonana"
],
"promoted": [
"doc-a1b2c3", "doc-a3b3c4", "doc-445"
],
"hidden": [
"doc-a9b8c7"
]
}'
用 DELETE 刪除指定id的策展
curl -X DELETE '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''
感謝閱讀,今天就到這邊拉~明天就是最後一篇文章了,真是讓人捨不得啊!