Authentication
Client Credentials
先申請 client_id 與 client_secret,並使用 application/x-www-form-urlencoded 取得 Token,認證流程參考下方範例
Request Example
curl \
-X POST https://login.lafresh.com.tw/oauth/v1/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=<CLIENT_ID>" \
-d "client_secret=<CLIENT_SECRET>" \
-d "grant_type=client_credentials" \
-d "scope=api"
Response
{
"access_token": "<token>",
"expires_in": 2592000,
"token_type": "Bearer",
"scope": "api"
}
Usage
使用 OAuth 2.0 Bearer Token。
curl \
-X GET https://omni.lafresh.com.tw/v1/stores \
-H "authorization: Bearer <token>"