跳到內容
登入系統

驗證方式

此內容適用於 5.0 (Preview)。 切換至 4.5(目前版本) 以查看目前正式版文件。

所有發送至 QUEUE 後端服務的請求,都必須在 HTTP Header 中帶入 access_token。

終端機視窗
curl --location -g --request GET 'https://reporting.qpos.me/cubejs-api/v1/load?query={QUERY}' \
--header 'Authorization: Bearer {access_token}'
var axios = require("axios");
var config = {
method: "get",
url: "https://reporting.qpos.me/cubejs-api/v1/load?query={QUERY}",
headers: {
Authorization: "Bearer {access_token}",
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
終端機視窗
https://capi.qpos.me/login
欄位 說明
email 電子郵件
password 密碼
終端機視窗
curl --request POST 'https://capi.qpos.me/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=user@mail.com' \
--data-urlencode 'password=secret_password'
{
"access_token": "eyJhbGciOiJSU...",
"refresh_token": "AFxQ4_pd...",
"expires_in": 3600
}
終端機視窗
https://capi.qpos.me/refresh

當 Access Token 即將過期或已過期時,可使用 Refresh Token 換取新的 Access Token。若 Refresh Token 已失效或被撤銷,使用者必須重新登入以取得新的權杖組。

欄位 說明
refresh_token 登入時取得的 Refresh Token
終端機視窗
curl --request POST 'https://capi.qpos.me/refresh' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'refresh_token=AFxQ4_r8BapvEWi81RJ...'
{
"access_token": "eyJhbGciOiJSU...",
"refresh_token": "AFxQ4_pd...",
"expires_in": 3600
}