Endpoint
本單元列出 HTTP 與完整路徑到端點endpoint. 基本 REST 架構
<HTTP verb> http://<host>/rest/<scope>/<endpoint>
where:
Element | Description |
HTTP verb | One of GET, POST, PUT, or DELETE |
host | The hostname or IP address (and optionally, port) of the RCE installation. |
scope | Specifies which store the call affects. In this tutorial, this value is default. |
endpoint | The full URI (Uniform Resource Identifier) to the endpoint. These values always start with /V1. For example, /V1/orders/4. |
HTTP headers
此部分指示您必須在 HTTP headers中指定哪些鍵/值對。所有調用都需要一個或多個 HTTP headers.
Payload
列出了發送到 RCE 的資訊。所有樣本都是有效的,可以複製貼到您的Call中,但您可能需要更改 RCE 返回的 id 值。
Response
列出了 RCE 發送給 REST 客戶端的資訊。這些值通常引用在本教程的其他步驟中。RCE 返回的值可能與本教程提供的示例中列出的值不同。
獲取管理員 Admin Authorization Token
對 RCE 的 REST 調用需要authorization token。該 token允許 RCE 驗證調用者是否有權訪問系統資源。要獲取token,您必須在有效負載中指定用戶的帳戶名稱和密碼。
默認情況下,admin token 的有效期為 4 小時。
Endpoint
POST https://<host>/rest/default/V1/integration/admin/token
Headers
Content-Type application/json
Payload
{"username": "admin","password": "123123q"}
Response
The RCE returns the admin’s access token.
5r8cvmpr11j6gmau8990rcj2qk7unh8i
This token must be specified in the authorization header of every call that requires admin permissions.
範例
Rezolve 維護 Swagger文件,這些文件描述了可用於獲取訂單資訊的各種 API 方法。這些文件可以在這裡找到:
以下是一些特定的 Order API 範例: