查詢批次提案單

批次提案 #

查詢批次提案單 #

查詢已建立的 批次提案單

Endpoint URL: https://tw.supplier.yahoo.com/api/spa/v1/proposal/batch
HTTP Method: GET

Request Parameters #

id #

提案單號,可以使用 , 分隔多個批次提案單號一次取得多筆資料。
資料型態: String
必填: 否

batchSource #

批次提案來源,詳見 定義表
資料型態: String
必填: 否
有效值:

  • excel
  • page
  • api

listingId #

賣場編號,可以使用 , 分隔多個賣場編號一次取得多筆資料。
資料型態: String
必填: 否

executeStatus #

執行狀態,可以使用 , 分隔多個執行狀態一次取得多筆資料。詳見 批次提案執行/回檔狀態 取得執行狀態列表。
資料型態: String
必填: 否

executeTs #

執行時間區間,為 ISO-8601 時間間隔格式,使用 / 分隔開始時間和結束時間。例如 2024-10-01T00:00:00Z/2024-10-31T00:00:00Z
資料型態: String
格式: ISO-8601
必填: 否

revertStatus #

回檔狀態,可以使用 , 分隔多個回檔狀態一次取得多筆資料。詳見 批次提案執行/回檔狀態 取得回檔狀態列表。
資料型態: String
必填: 否

revertTs #

回檔時間區間,為 ISO-8601 時間間隔格式,使用 / 分隔開始時間和結束時間。例如 2024-10-01T00:00:00Z/2024-10-31T00:00:00Z
資料型態: String
格式: ISO-8601
必填: 否

sort #

結果排序條件,可使用的條件包括 id, executeTs, revertTs, createdTs, modifiedTs。前方加上 - 表示降冪排序、+ 表示升幂排序。
資料型態: String
必填: 否
預設值: -id

fields #

於查詢時同時要求回傳附加欄位,目前支援的欄位包括:

  • +details 回傳提案明細

資料型態: String
必填: 否

offset #

用於搜尋結果分頁,表示從搜尋結果的第幾筆開始回傳。
資料型態: Integer
必填: 否
預設值: 0
最小值: 0

limit #

用於搜尋結果分頁,表示一次回傳幾筆搜尋結果。
資料型態: Integer
必填: 否
預設值: 15
最小值: 0
最大值: 50

Response Syntax #

{
  "pagination": {
    "nextOffset": number,
    "resultsTotal": number
  },
  "proposals": [
    {
      "id": number,
      "supplierId": number,
      "proposalType": string,
      "batchSource": string,
      "instantExecute": boolean,
      "details": [
        {
          "listingId": number,
          "executeProposalId": number,
          "revertProposalId": number
        }
      ],
      "executeTs": string,
      "executeStatus": string,
      "executor": string,
      "executeDetail": string,
      "revertTs": string,
      "revertStatus": string,
      "reverter": string,
      "revertDetail": string,
      "creator": string,
      "createdTs": string,
      "modifier": string,
      "modifiedTs": string
    }
  ]
}

Response Elements #

若操作成功,API 會回傳 HTTP 200 response。下述資料會以 JSON 格式回傳。

pagination #

搜尋結果的分頁資訊,若有未回傳資料,會提供 nextOffset 表示下一次請求時可從何 offset 開始,而 resultsTotal 表示符合該條件的結果總數。
資料型態: Pagination

proposals #

符合搜尋條件的提案單物件。
資料型態: BatchProposal

Errors #

Bad Request #

輸入的參數不符合 API 定義的 Pattern。
HTTP Status Code: 400

Error Code Description
0 Invalid input
40000001 Wrong timestamp format
40000005 Contains illegal character(s)

Unauthorized #

身分認證不通過,請檢查您的 Cookiewssid
HTTP Status Code: 401

Error Code Description
40100001 Missing or bad authentication
40100002 Invalid cookie
40100003 Missing or bad authentication
40100004 Check wssid failed
40100006 Cookie has expired

Internal Server Error #

API 端發生錯誤,若持續發生請洽您的業務窗口。

Examples #

取得提案單號為 1 與 2 的提案單,並按照提案單號遞減排序
GET /api/spa/v1/proposal/batch?id=1,2 HTTP/1.1
HOST: tw.supplier.yahoo.com
Content-Type: application/json; charset=UTF-8
{
  "proposals": [
    {
      "id": 2,
      "supplierId": 99999,
      "proposalType": "updateImageV2",
      "batchSource": "excel",
      "executeTs": "2024-04-10T02:00:00Z",
      "executeStatus": "failed",
      "executor": "executor-id",
      "executeDetail": "execute detail",
      "revertTs": "2024-04-10T05:00:00Z",
      "revertStatus": "idle",
      "creator": "creator-id",
      "createdTs": "2024-04-09T10:05:00Z",
      "modifier": "modifier-id",
      "modifiedTs": "2024-04-10T02:00:05Z"
    },
    {
      "id": 1,
      "supplierId": 99999,
      "proposalType": "updateImageV2",
      "batchSource": "excel",
      "executeTs": "2024-04-10T02:00:00Z",
      "executeStatus": "idle",
      "revertTs": "2024-04-10T05:00:00Z",
      "revertStatus": "idle",
      "creator": "creator-id",
      "createdTs": "2024-04-09T10:00:00Z",
      "modifier": "modifier-id",
      "modifiedTs": "2024-04-09T10:05:00Z"
    }
  ],
  "pagination": {
    "resultsTotal": 2
  }
}
取得提案單號為 1 的提案單,並且取得提案單的額外欄位 details
GET /api/spa/v1/proposal/batch?id=1&fields=+details HTTP/1.1
HOST: tw.supplier.yahoo.com
Content-Type: application/json; charset=UTF-8
{
  "pagination": {
    "resultsTotal": 1
  },
  "proposals": [
    {
      "id": 1,
      "supplierId": 99999,
      "proposalType": "updateImageV2",
      "batchSource": "excel",
      "details": [
        {
          "listingId": 12345,
          "executeProposalId": 1001,
          "revertProposalId": 1002
        },
        {
          "listingId": 22345,
          "executeProposalId": 1003,
          "revertProposalId": 1004
        }
      ],
      "executeTs": "2024-04-10T02:00:00Z",
      "executeStatus": "idle",
      "revertTs": "2024-04-10T05:00:00Z",
      "revertStatus": "idle",
      "creator": "creator-id",
      "createdTs": "2024-04-09T10:00:00Z",
      "modifier": "modifier-id",
      "modifiedTs": "2024-04-09T10:05:00Z"
    }
  ]
}