Back to top

Echoss VIP

外部活動

「外部活動」 優惠卷匯入

「外部活動」 優惠卷匯入
POST/api/external/voucher_statements

  • 以下主要列出幾種常見的 status error code, 若沒有列出的, 請以 HTTP Status Code 標準判斷

  • 以下為必帶欄位

    • voucher_identifier (優惠卷唯一碼)
    • voucher_number (優惠卷編號)
    • voucher_name (優惠卷名稱)
    • line_id
    • brand_id (品牌 id)
    • promotion_id (活動 id)
    • sent_at
  • 以下為 optional 欄位

    • brand_manager_id (為品牌管理者/門市管理者帳號 id, 若無請帶 int 0)
    • used_at, 若無請帶 null
    • cancelled_at, 若無請帶 null
  • 以下三個欄位若同時重複, 則使用新紀錄覆蓋原有紀錄

    • brand_id (品牌 id)
    • promotion_id (活動 id)
    • voucher_identifier (優惠卷唯一碼)
  • 422 status code 表示欄位驗證錯誤, 可能為

    • 型別錯誤
    • 該帶欄位有缺
  • 時間格式請帶 ISO8601, 避免任何時區上的可能錯誤

  • 401 為 credential 驗證失敗

  • 流程圖參考

Example URI

POST /api/external/voucher_statements
Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
Authorization: Bearer ZWNob3NzX3N0YXRlbWVudHNfdGVtcG9yYXJ5X3Rva2VuCg==
Body
{
  "data": [
    {
      "brand_id": 1,
      "promotion_id": 2,
      "voucher_identifier": "2223",
      "voucher_name": "瓦城 288元",
      "voucher_number": "V00A004S0013FCS00",
      "line_id": "fb3d6a16-b5d6-4bf8-8fd2-7acd0ec15944",
      "sent_at": "2021-02-17 02:06:55+00:00",
      "used_at": "2021-02-17T02:06:55Z",
      "brand_manager_id": 0,
      "cancelled_at": "2021-02-17 02:06:55+00:00"
    },
    {
      "brand_id": 1,
      "promotion_id": 2,
      "voucher_identifier": "222",
      "voucher_name": "瓦城 288元 平日好運金",
      "voucher_number": "V00A004S0013FCS00804",
      "line_id": "b3f322b8-d176-4a04-8de5-c08f28b319f6",
      "sent_at": "2021-02-17T02:06:55Z",
      "used_at": "2021-02-17T02:06:55Z",
      "brand_manager_id": 3,
      "cancelled_at": "2021-02-17T02:06:55Z"
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X9bf6b08799b87ecfe85dfa34bc3ba127
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "These credentials do not match our records."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "data.0.activity": [
      "The data.0.activity must be a string.",
      "The data.0.activity field is required."
    ]
  }
}

「外部活動」 點數匯入

「外部活動」 點數匯入
POST/api/point_statements

  • 以下為必帶欄位

    • line_id
    • brand_id (品牌 id)
    • promotion_id (活動 id)
    • change_reason (變更原因)
    • point_change_record (變更紀錄)
    • changed_at
  • 以下為 optional 欄位

    • brand_manager_id (為品牌/門市管理帳號 id), 若無請帶 int 0
  • 為了之後資料的可用性, 目前 change_reason 只允許帶入以下選項

    • 集點
    • 兌換
    • 取消
  • 以下主要列出幾種常見的 status error code, 若沒有列出的, 請以 HTTP Status Code 標準判斷

  • 422 status code 表示欄位驗證錯誤, 可能為

    • 型別錯誤
    • 該帶欄位缺少
  • 時間格式請帶 ISO8601, 避免任何時區上的可能錯誤

  • 401 為 credential 驗證失敗

Example URI

POST /api/point_statements
Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
Authorization: Bearer ZWNob3NzX3N0YXRlbWVudHNfdGVtcG9yYXJ5X3Rva2VuCg==
Body
{
  "data": [
    {
      "brand_id": 0,
      "promotion_id": 0,
      "line_id": "b70c3e08-57a0-4a57-87a8-d32cb9677a1f",
      "change_reason": "集點",
      "point_change_record": -2,
      "changed_at": "2021-03-01T00:00:00+08:00",
      "brand_manager_id": 0
    },
    {
      "brand_id": 0,
      "promotion_id": 0,
      "line_id": "91d1d21e-3213-4930-9429-96de5fca67e2",
      "change_reason": "取消",
      "point_change_record": -2,
      "changed_at": "2021-02-17T01:29:14Z",
      "brand_manager_id": 0
    }
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X9a2cba59df8b6ce0bd81df678bf69ab0
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "These credentials do not match our records."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: Xeff5a4f91dbcc0317742db078172c322
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "data.0.promotion_name": [
      "The data.0.promotion_name field is required."
    ]
  }
}

公司

「公司管理者」登入

「公司管理者」登入
POST/api/admin/login

  • 401 表示帳密錯誤

  • 422 表示欄位格式錯誤

    • 太長, 最多 255 字
    • 帳號只允許英文加數字, 至少 8 個字
    • 密碼為英文數字至少各1, 8-20 個字

Example URI

POST /api/admin/login
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Body
{
  "account": "test1234",
  "password": "test1234"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X75eac766972f30da44e3587fd523c6cc
Vary: Accept-Encoding
Body
{
  "data": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTE1NjE1NTYsImV4cCI6MTYxMTU2NTE1NiwibmJmIjoxNjExNTYxNTU2LCJqdGkiOiJKUHlBakZZZTBxQXdOa2ZJIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.S8XBteTsLNKNQJRddnc62oO1-21mUsE3bWgONXB3_Lg"
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Body
{
  "message": "These credentials do not match our records."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X0e39e7057221cd45e24838a556692478
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "password": [
      "The password format is invalid."
    ]
  }
}

「公司管理者」登出

「公司管理者」登出
POST/api/admin/logout

  • Token 經由 [POST /api/admin/login] 獲得

  • 401 為 token 錯誤

Example URI

POST /api/admin/logout
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTE1NjcwMTQsImV4cCI6MTYxMTU3MDYxNCwibmJmIjoxNjExNTY3MDE0LCJqdGkiOiIxV3czUFFvamVQZnRuVVFxIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.jmvzZSRSZLaacauXxLHJ2-pgz0RXwOA_GcJifjSHicE
Body
{
  "account": "test1234",
  "password": "test1234"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X012a5993b4cb66559231f5d618fb56dd
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully logout"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X4958c97b5c8d151c70d682c1b319b575
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「公司管理者」Refresh Token

「公司管理者」Refresh Token
POST/api/admin/refresh-token

Example URI

POST /api/admin/refresh-token
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuY2hcL2xvZ2luIiwiaWF0IjoxNjEyMjQzNjQ1LCJleHAiOjE2MTI0NTk2NDUsIm5iZiI6MTYxMjI0MzY0NSwianRpIjoiSERHaFFnRmdieEhNRUVQbSIsInN1YiI6MTYsInBydiI6IjhmOWFlMTA0NDMyZTViMWFlMWI5YzAxMjYzMjgwZTZjMjI0ZTlmNGYifQ.wDmvMYdA-w7z0YXNL2W8AmlFRfBpu_730Sns8-H7zb0
Body
{}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xba9bc2bdd31bfc76bd476495601c7290
Vary: Accept-Encoding
Body
{
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuY2hcL3JlZnJlc2gtdG9rZW4iLCJpYXQiOjE2MTIyNDM2NDUsImV4cCI6MTYxMjQ1OTY1MSwibmJmIjoxNjEyMjQzNjUxLCJqdGkiOiJpSGhmN3E5TmRSYm9CS2FMIiwic3ViIjoxNiwicHJ2IjoiOGY5YWUxMDQ0MzJlNWIxYWUxYjljMDEyNjMyODBlNmMyMjRlOWY0ZiJ9.SVvwkpRlG23Zop6TgIJz2hEV7FAJofe09yOupDQz3RY",
    "token_type": "bearer",
    "expires_in": 216000
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X504b04fbfec5f29af2d3fa205060cc3b
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「公司管理者」取得單一品牌資訊

「公司管理者」取得單一品牌資訊
GET/api/admin/brands/3

  • Token 經由 [POST /api/admin/login] 獲得

  • 在 url parameter 帶入 brand_id

  • 404 為找不到指定的 brand

  • brand_url 為品牌專屬 url

  • logo 若不存在則為 null

Example URI

GET /api/admin/brands/3
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTE3Mzg2NDgsImV4cCI6MTYxMTc0MjI0OCwibmJmIjoxNjExNzM4NjQ4LCJqdGkiOiI2VGJZQ1ZrcDFJRjI3RHBIIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.nIHGFfai2Wpr_kcXe9k-W1wAGYkjxBIVPL1wWv4HiyE
Response  200
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "data": {
    "id": 2,
    "name": "testname2",
    "brand_url": "https://echoss.test/testidentifier2",
    "logo": "https://echoss.test/testidentifier2/logo2"
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "No query results for model [App\\Models\\brand] 3"
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X0191eeb0bccb3f8f5f0d4de7d2c7103c
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「公司管理者」建立品牌

「公司管理者」建立品牌
POST/api/admin/brands

  • identifier 即代表該品牌的 url, 不可重複

  • password 為 8-20 字, 英文數字至少各 1

  • account 為英文數字

  • liff_id 可帶可不帶

  • 401 為 token 錯誤

  • 422 為 input 格式錯誤

  • 所有欄位皆不容許符號

Example URI

POST /api/admin/brands
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTIyNDM2MzIsImV4cCI6MTYxMjQ1OTYzMiwibmJmIjoxNjEyMjQzNjMyLCJqdGkiOiI0cUlVQzRUMmg5UWZqV2pwIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.E8jACj6WGB6rcH3CDXs_HtyLWD96tlCsv9HOemcr3B4
Body
{
  "account": "testaccount4",
  "password": "test1234",
  "password_confirmation": "test1234",
  "name": "測試1",
  "identifier": "7skKuYoUpwiXUAYuoCpJ",
  "liff_id": "fjeklafjal"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xef6f1c31705c23dda35f5e71e7491a3d
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created!"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X0191eeb0bccb3f8f5f0d4de7d2c7103c
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「公司管理者」Me

「公司管理者」Me
GET/api/admin/me

  • 401 表示 token 錯誤

Example URI

GET /api/admin/me
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTIyNDM2MzIsImV4cCI6MTYxMjQ1OTYzMiwibmJmIjoxNjEyMjQzNjMyLCJqdGkiOiI0cUlVQzRUMmg5UWZqV2pwIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.E8jACj6WGB6rcH3CDXs_HtyLWD96tlCsv9HOemcr3B4
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xb5a6d7fc65ed341ad540494439f0a8b7
Vary: Accept-Encoding
Body
{
  "data": {
    "id": 1,
    "account": "test1234"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X00f67b7ba89333fb650aad8e68b8d5d0
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「公司管理者」取得品牌資訊

「公司管理者」取得品牌資訊
GET/api/admin/brands?rows=1

  • 401 為 token 錯誤

  • 422 為 rows 格式錯誤 (只能帶數字)

  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

Example URI

GET /api/admin/brands?rows=1
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTE3OTgyMjIsImV4cCI6MTYxMTgwMTgyMiwibmJmIjoxNjExNzk4MjIyLCJqdGkiOiJ5M295eXBlclB6WkN0SnZmIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.B4Skquw_3ljiQ-icm67Z2zMoPR2IRw4qfZw8OUAuA9w
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X0b84d10732eb71ca9a96d9eef88fd875
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 1,
      "name": "testname1"
    }
  ],
  "links": {
    "first": "http://echoss.test/api/admin/brands?rows=1&page=1",
    "last": "http://echoss.test/api/admin/brands?rows=1&page=3",
    "prev": null,
    "next": "http://echoss.test/api/admin/brands?rows=1&page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 3,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://echoss.test/api/admin/brands?rows=1&page=1",
        "label": 1,
        "active": true
      },
      {
        "url": "http://echoss.test/api/admin/brands?rows=1&page=2",
        "label": 2,
        "active": false
      },
      {
        "url": "http://echoss.test/api/admin/brands?rows=1&page=3",
        "label": 3,
        "active": false
      },
      {
        "url": "http://echoss.test/api/admin/brands?rows=1&page=2",
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http://echoss.test/api/admin/brands",
    "per_page": "1",
    "to": 1,
    "total": 3
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X0191eeb0bccb3f8f5f0d4de7d2c7103c
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X36e87e2d12ba7a79f336e4a8123e8b70
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "rows": [
      "The rows must be an integer."
    ]
  }
}

「公司管理者」更新密碼

「公司管理者」更新密碼
POST/api/admin/reset-password

  • 401 為 token 錯誤

  • 422 為 input 格式錯誤或密碼錯誤

  • 密碼為英文數字至少各1, 8-20 個字

Example URI

POST /api/admin/reset-password
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTE4MDA0MDcsImV4cCI6MTYxMTgwNDAwNywibmJmIjoxNjExODAwNDA3LCJqdGkiOiJJbWdaeHVJY1RRVXZTbDBnIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.rBCArTsBwNZO967ttvpNV5m-XcdVtAeVKMzMULtPXAA
Body
{
  "password": "test1238",
  "new_password": "test1238",
  "new_password_confirmation": "test1238"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X84e9eee28c4e1c0ce266ee9bd94ab608
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "Unauthenticated"
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "new_password": [
      "The new password confirmation does not match."
    ]
  }
}

「公司管理者」更新單一品牌

「公司管理者」更新單一品牌
PATCH/api/admin/brands/1

  • 欄位如下

    • name: 可帶可不帶, 有帶才更新
    • logo: 可帶可不帶, 有帶才更新
    • delete_logo: 可帶可不帶, 只可帶 1/0
      • 1: 會刪除現有 logo, 而 logo 欄位無作用
      • 0: 效果等同沒帶
  • 422 為 input 格式錯誤

    • 不允許符號
    • logo 需為 image file, extension 限定 jpg,png, 大小最大 1.5MB
  • 401 為 token 錯誤

Example URI

PATCH /api/admin/brands/1
Request
HideShow
Headers
Content-Type: multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9hZG1pblwvbG9naW4iLCJpYXQiOjE2MTIyNDM2MzIsImV4cCI6MTYxMjQ1OTYzMiwibmJmIjoxNjEyMjQzNjMyLCJqdGkiOiI0cUlVQzRUMmg5UWZqV2pwIiwic3ViIjoxLCJwcnYiOiJkZjg4M2RiOTdiZDA1ZWY4ZmY4NTA4MmQ2ODZjNDVlODMyZTU5M2E5In0.E8jACj6WGB6rcH3CDXs_HtyLWD96tlCsv9HOemcr3B4
Body
--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="name"

LH3Xf42eOASxoPXf

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="logo"

file

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="_method"

PATCH

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="delete_logo"

1

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="liff_id"

feafew

--__X_PAW_BOUNDARY__--
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X44b4337921391bb1313b35f4616152cf
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X60668e0c6331ffee9bfe875f1ab808c5
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "logo": [
      "The logo must be an image.",
      "The logo must be a file of type: jpeg, png."
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: Xb5a64b47dda8dd69bb0843fbd2d13412
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

品牌

「品牌管理者」登入

「品牌管理者」登入
POST/api/brand-manager/login

  • 需帶入品牌 identifier 以辨識品牌

  • 401 表示帳密錯誤

  • 422 表示欄位格式錯誤

    • 太長, 最多 255 字
    • 帳號只允許英文加數字, 至少 8 個字
    • 密碼為英文數字至少各1, 8-20 個字
    • 不允許符號

Example URI

POST /api/brand-manager/login
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Body
{
  "account": "testaccount4",
  "password": "test1234",
  "identifier": "tRfuToP7"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X274ccabc931b4dfcd9fcc4ea8aecf3d6
Vary: Accept-Encoding
Body
{
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMjg3Mjc0NCwiZXhwIjoxNjEzMDg4NzQ0LCJuYmYiOjE2MTI4NzI3NDQsImp0aSI6InpuT3RlMXpWOVFocHpXY0EiLCJzdWIiOjIsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.xGMeogJwCR_4pd_Gv_WZP6vqb_QfzDq1hWqhiefcMsg",
    "token_type": "bearer",
    "expires_in": 216000
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
Body
{
  "message": "These credentials do not match our records."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "account": [
      "The account may only contain letters and numbers."
    ]
  }
}

「品牌管理者」登出

「品牌管理者」登出
POST/api/brand-manager/logout

  • 401 表示 token 錯誤

Example URI

POST /api/brand-manager/logout
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMjg3Mjc0NCwiZXhwIjoxNjEzMDg4NzQ0LCJuYmYiOjE2MTI4NzI3NDQsImp0aSI6InpuT3RlMXpWOVFocHpXY0EiLCJzdWIiOjIsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.xGMeogJwCR_4pd_Gv_WZP6vqb_QfzDq1hWqhiefcMsg
Body
{
  "account": "test1234",
  "password": "test1234"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xd9f08259b91db7bec53043bfeb966686
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully logout"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」Refresh Token

「品牌管理者」Refresh Token
POST/api/brand-manager/refresh-token

Example URI

POST /api/brand-manager/refresh-token
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMjg3Mjc0NCwiZXhwIjoxNjEzMDg4NzQ0LCJuYmYiOjE2MTI4NzI3NDQsImp0aSI6InpuT3RlMXpWOVFocHpXY0EiLCJzdWIiOjIsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.xGMeogJwCR_4pd_Gv_WZP6vqb_QfzDq1hWqhiefcMsg
Body
{}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X49d1b1339d5695060e55f13982f469c1
Vary: Accept-Encoding
Body
{
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9yZWZyZXNoLXRva2VuIiwiaWF0IjoxNjEyODcyNzQ0LCJleHAiOjE2MTMwODkxMDEsIm5iZiI6MTYxMjg3MzEwMSwianRpIjoiU1NER2FDOUhYS21ZU2JYcCIsInN1YiI6MiwicHJ2IjoiNjlmM2QxMDI1Nzg0YjEzMTM0OGM5N2MzZDAxOWMwZmNiNTFiMjg5ZiJ9.q1vfpker2TzRYn8OrSKJ7bsT0XeVOa02ggcd74OsaQA",
    "token_type": "bearer",
    "expires_in": 216000
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: Xa015aa5389e96f7927d6bd8910870681
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」取得品牌管理者 / 門市管理者自身資料

「品牌管理者」取得品牌管理者 / 門市管理者自身資料
GET/api/brand-manager/me

  • 401 表示 token 錯誤

Example URI

GET /api/brand-manager/me
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X332a8bb3b7b839125a61fdc80e9268f2
Vary: Accept-Encoding
Body
{
  "data": {
    "id": 1,
    "brand_id": 1,
    "account": "testaccount4",
    "shop_name": "測試1",
    "created_at": "2021-02-10T15:59:05+08:00",
    "status": 1,
    "required_registration_toggles": {
      "id": 1,
      "user_phone": 1,
      "user_name": 1,
      "user_birth": 2,
      "user_email": 2,
      "user_gender": 2,
      "user_city": 1,
      "user_job": 2,
      "user_edu": 2,
      "user_mrg": 2,
      "user_hbt": 1,
      "user_diet": 2
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X6ee624160e0e46f524046b74453e9d30
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」修改密碼

「品牌管理者」修改密碼
POST/api/brand-manager/reset-password

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

    • 現有密碼不符
    • 太長, 最多 255 字
    • 密碼為英文數字至少各1, 8-20 個字
    • new_password, new_password_confirmation 需相符

Example URI

POST /api/brand-manager/reset-password
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMjg3MzEzNywiZXhwIjoxNjEzMDg5MTM3LCJuYmYiOjE2MTI4NzMxMzcsImp0aSI6IlRuTVIwUzF4clUzWkxVU3kiLCJzdWIiOjIsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.NVm2g16bodpQXFQu7U315bhSnaiAg9OxZxOjciymXNQ
Body
{
  "password": "test1234",
  "new_password": "test1234",
  "new_password_confirmation": "test1234"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X9d0c48e6f44930ad228d94a326b4b943
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "new_password": [
      "The new password confirmation does not match."
    ]
  }
}

「品牌管理者」建立品牌管理子帳號

「品牌管理者」建立品牌管理子帳號
POST/api/brand-manager/sub-brand-managers

  • account 以及 shop_name 在同品牌下不允許重複

  • shop_name 不可重複

  • account 不可重複

  • role_id

    • 2: 門市
    • 3: 客服
  • 401 表示密碼或 token 錯誤

  • 422 表示欄位格式錯誤

    • 帳號最多 50 字, 不允許符號
    • 密碼為英文數字至少各1, 8-20 個字
    • new_password, new_password_confirmation 需相符

Example URI

POST /api/brand-manager/sub-brand-managers
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9kZXZ2aXAuMTJjbS5jb20udHdcL2FwaVwvYnJhbmQtbWFuYWdlclwvbG9naW4iLCJpYXQiOjE2MTQ0MzAyODMsImV4cCI6MTYxNDUxNjY4MywibmJmIjoxNjE0NDMwMjgzLCJqdGkiOiJ4MWxzajdDWlpBb1hMNklzIiwic3ViIjo1LCJwcnYiOiI2OWYzZDEwMjU3ODRiMTMxMzQ4Yzk3YzNkMDE5YzBmY2I1MWIyODlmIn0.V9IH_zN9H8h7eAZOIAOd0ZRW-MLutCs6jzusjHm8ewA
Body
{
  "account": "9kcLm6hEcALMr6WD",
  "shop_name": "Zd0fH3PF90DJUoMK8t4D",
  "password": "test1234",
  "password_confirmation": "test1234",
  "role_id": "3"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.14
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X847e366217b55dbd944de1bfa64258b8
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Body
{
  "data": {
    "message": "Successfully created."
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X8941ea611c97bf318e623dba9187ae93
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "password": [
      "The password format is invalid."
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」取得品牌管理子帳號

「品牌管理者」取得品牌管理子帳號
GET/api/brand-manager/sub-brand-managers?direction=desc&sort=created_at&rows=5

  • account & shop_name 為模糊搜尋

  • sort: 排序欄位

    • 建立時間: created_at
  • direction: 排序規則, 預設 desc

    • desc (大至小, 新至舊)
    • asc (小至大, 舊至新)
  • 回傳 role_id 代表

    • 2: 門市
    • 3: 客服
  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

Example URI

GET /api/brand-manager/sub-brand-managers?direction=desc&sort=created_at&rows=5
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9kZXZ2aXAuMTJjbS5jb20udHdcL2FwaVwvYnJhbmQtbWFuYWdlclwvbG9naW4iLCJpYXQiOjE2MTQ0MzAyODMsImV4cCI6MTYxNDUxNjY4MywibmJmIjoxNjE0NDMwMjgzLCJqdGkiOiJ4MWxzajdDWlpBb1hMNklzIiwic3ViIjo1LCJwcnYiOiI2OWYzZDEwMjU3ODRiMTMxMzQ4Yzk3YzNkMDE5YzBmY2I1MWIyODlmIn0.V9IH_zN9H8h7eAZOIAOd0ZRW-MLutCs6jzusjHm8ewA
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.14
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X793623acb3f4909599336e62405d8193
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Body
{
  "data": [
    {
      "id": 6,
      "brand_id": 4,
      "account": "testaccount1",
      "shop_name": "測試門市",
      "created_at": "2021-02-10T01:31:23+08:00",
      "status": 1,
      "role_id": 2
    },
    {
      "id": 8,
      "brand_id": 4,
      "account": "testaccount2",
      "shop_name": "測試門市2",
      "created_at": "2021-02-18T22:43:34+08:00",
      "status": 1,
      "role_id": 2
    },
    {
      "id": 15,
      "brand_id": 4,
      "account": "xVq4mbzQnP8h8",
      "shop_name": "1qnntE1J8B",
      "created_at": "2021-02-23T16:40:40+08:00",
      "status": 1,
      "role_id": 2
    },
    {
      "id": 16,
      "brand_id": 4,
      "account": "8HRvzpVZZ",
      "shop_name": "ZysLODmWoulXWbs",
      "created_at": "2021-02-27T20:51:28+08:00",
      "status": 1,
      "role_id": 3
    }
  ],
  "links": {
    "first": "http://devvip.12cm.com.tw/api/brand-manager/sub-brand-managers?page=1",
    "last": "http://devvip.12cm.com.tw/api/brand-manager/sub-brand-managers?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://devvip.12cm.com.tw/api/brand-manager/sub-brand-managers?page=1",
        "label": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http://devvip.12cm.com.tw/api/brand-manager/sub-brand-managers",
    "per_page": 20,
    "to": 4,
    "total": 4
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X13f2a64069a71be1b791262a3de1d29b
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "rows": [
      "The rows must be an integer."
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X893ece9d7e6777e4594cf22e97dfc2e5
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」更新單一門市帳號

「品牌管理者」更新單一門市帳號
PUT/api/brand-manager/sub-brand-managers/4

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

    • account 以及 shop_name 在同品牌下不允許重複
    • 帳號最多 50 字, 不允許符號
    • 密碼為英文數字至少各1, 8-20 個字
    • new_password, new_password_confirmation 需相符
  • 403 表示不當存取

    • 品牌帳號嘗試更新自己
    • 品牌帳號嘗試更新其他品牌的門市帳號
  • status_id:

    • 1 為啟用
    • 2 為不啟用

Example URI

PUT /api/brand-manager/sub-brand-managers/4
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMjg3MzEzNywiZXhwIjoxNjEzMDg5MTM3LCJuYmYiOjE2MTI4NzMxMzcsImp0aSI6IlRuTVIwUzF4clUzWkxVU3kiLCJzdWIiOjIsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.NVm2g16bodpQXFQu7U315bhSnaiAg9OxZxOjciymXNQ
Body
{
  "account": "testaccount12",
  "shop_name": "333321",
  "password": "test3354",
  "password_confirmation": "test3354",
  "status_id": 1
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xa355e84e6a3519ba8889ea7c0acc1cf6
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "brand manager can not update itself."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X8941ea611c97bf318e623dba9187ae93
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "password": [
      "The password format is invalid."
    ]
  }
}

「品牌管理者」更新註冊必要欄位開關

「品牌管理者」更新註冊必要欄位開關
PATCH/api/brand-manager/required-registration-toggles/1

  • 當欄位 status 為啟用時, 會員註冊需帶入該欄位

  • 當欄位 status 為不啟用時, 會員註冊時將忽略該欄位

  • required-registration-toggle id 經由 「品牌管理者」取得品牌管理者 / 門市管理者自身資料 API 取得

  • Status:

    • 1 為啟用
    • 2 為不啟用
  • 401 為 token 不合法

  • 422 為欄位錯誤

  • 只允許帶入 status 1 或 2

Example URI

PATCH /api/brand-manager/required-registration-toggles/1
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMzc5OTk2OSwiZXhwIjoxNjE0MDE1OTY5LCJuYmYiOjE2MTM3OTk5NjksImp0aSI6IjczbHRCaG85NVFkd3QxN1kiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.CtVJ2mgFT_Bk2xwzUYL2mRajWhf7Nu4u9glVW64qWak
Body
{
  "user_phone": 2,
  "user_gender": 2,
  "user_city": 1,
  "user_job": 2,
  "user_edu": 2,
  "user_mrg": 2,
  "user_hbt": 1,
  "user_diet": 2,
  "user_email": 2,
  "user_birth": 1
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 56
X-RateLimit-Limit: 60
phpdebugbar-id: Xc339e392da43115861e4c45f0f9b31e3
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X47fb9e3cbfc118eaa81bde735b6602a8
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: Xcbd4c862c941a28ea42f5d5e2f7521fb
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "city": [
      "Invalid toggle option."
    ]
  }
}

「品牌管理者」更新會員

「品牌管理者」更新會員
PATCH/api/brand-manager/members/706

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 422 表示欄位格式錯誤

  • 同品牌下 user_phone 需為 unique

  • 同品牌下 user_email 需為 unique

  • user_birth 格式為 Y-m-d

  • 以下欄位輸入需為規範值

    • user_city
    • user_job
    • user_edu
    • user_diet
    • user_mrg
    • user_hbt
    • user_gender
  • tags 為 array, item 為 tag_id, 可使用 「品牌管理員」取得所有標籤 API 獲得

  • 若要移除所有 tags, 請帶空 array

  • disconnect_line 請帶 boolean

Example URI

PATCH /api/brand-manager/members/706
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDUxOTQ1MywiZXhwIjoxNjE0NzM1NDUzLCJuYmYiOjE2MTQ1MTk0NTMsImp0aSI6ImNIREdPbENzbFVIaW5Bcm8iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.0ckpqmQQ_v0gHfY4shoRsGPz3KSy2ytdiAwkUkO3uoY
Body
{
  "user_phone": "0957515317",
  "user_email": "lizeth.mazzotta@fromwashingtondc.com",
  "user_name": "Carson",
  "user_birth": "1977-02-01",
  "user_city": "臺北市",
  "user_gender": "男性",
  "user_diet": "重肉食",
  "user_mrg": "未婚",
  "user_hbt": "科技",
  "user_job": "學生",
  "user_edu": "國中以下",
  "disconnect_line": true,
  "tags": [
    10,
    11,
    12,
    13
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xd6a469f83630f46a66f6362236a3c85b
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X4c51f372367efc814f6dff0346350f3f
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "user_city": [
      "Invalid city."
    ]
  }
}

「品牌管理者」取得單一會員

「品牌管理者」取得單一會員
GET/api/brand-manager/members/233

  • 403 品牌管理者只可取得該品牌會員

  • 401 token 錯誤

Example URI

GET /api/brand-manager/members/233
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxMzgwMDQzNiwiZXhwIjoxNjE0MDE2NDM2LCJuYmYiOjE2MTM4MDA0MzYsImp0aSI6Ino2ZVBua3dHa2puMVppUEciLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ._-KLbEWaqTMrUnZY3GxO0n2mNiYYdb61Ain3a4v9Ulk
Response  200
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "data": {
    "id": 233,
    "user_name": "Erwin Farrell",
    "user_phone": "+1-752-780-4229",
    "created_at": "2021-02-20T15:10:29+08:00",
    "user_birth": "2003-10-27",
    "user_gender": "男性",
    "user_city": "彰化縣",
    "user_job": "金融商業",
    "user_edu": "高中職",
    "user_email": "bwuckert@example.org",
    "user_mrg": "已婚",
    "user_diet": "環保素",
    "user_hbt": "文化藝術"
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」取得會員

「品牌管理者」取得會員
GET/api/brand-manager/members?sort=created_at&direction=asc&tags[]=12&tags[]=10

  • 模糊搜尋:

    • user_phone
    • user_name
  • 當天日期搜尋

    • created_at
  • sort: 排序欄位

    • 建立時間: created_at
  • direction: 排序規則, 預設 desc

    • desc (大至小, 新至舊)
    • asc (小至大, 舊至新)
  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

  • tags 為 array, item 為 tag_id, 可使用 「品牌管理員」取得所有標籤 API 獲得

Example URI

GET /api/brand-manager/members?sort=created_at&direction=asc&tags%5B%5D=12&tags%5B%5D=10
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDY0MjM0OCwiZXhwIjoxNjE0ODU4MzQ4LCJuYmYiOjE2MTQ2NDIzNDgsImp0aSI6IjB2Z2ZLeUZ3cXZhancyaTAiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.bOuai2HFIdFROD8X7ygRLf609Ldi75YNJBOyUEOrktk
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.14
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 56
X-RateLimit-Limit: 60
phpdebugbar-id: X174a73faaee5ae7ffea11b5ad975a61b
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Body
{
  "data": {
    "id": 14,
    "user_name": "Vincent",
    "user_phone": "0998764210",
    "created_at": "2021-02-20T18:54:37+08:00",
    "line_id": null,
    "user_birth": "1977-02-01",
    "user_gender": "女性",
    "user_city": "臺北市",
    "user_job": "學生",
    "user_edu": "國中以下",
    "user_email": "tobie.mccafferty@t2mail.com",
    "user_mrg": "未婚",
    "user_diet": "重肉食",
    "user_hbt": "科技",
    "tags": [
      {
        "id": 1,
        "name": "標籤 測試"
      },
      {
        "id": 2,
        "name": "測試2"
      },
      {
        "id": 3,
        "name": "測試3"
      },
      {
        "id": 4,
        "name": "KKKKK"
      }
    ]
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "rows": [
      "The rows must be an integer."
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
phpdebugbar-id: X47fb9e3cbfc118eaa81bde735b6602a8
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」取得所有會員

「品牌管理者」取得所有會員
GET/api/brand-manager/all-members

  • 401 表示 token 錯誤

  • 此 API cost 相當大, 限制 5 分鐘使用一次

Example URI

GET /api/brand-manager/all-members
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDA0NTA4NSwiZXhwIjoxNjE0MjYxMDg1LCJuYmYiOjE2MTQwNDUwODUsImp0aSI6IkoyQjA1ajlOdjBKQkNvM3AiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.Vk-Rlmat4GCLERmdWY9LhcLCHAR5VK5FholO7T_XgCA
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X954588693fccca78a711023a281fd84e
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 25,
      "user_name": "Retha Mante MD",
      "user_phone": "814.535.7600",
      "created_at": "2021-02-20T15:06:10+08:00",
      "user_birth": "1998-11-22",
      "user_gender": "男性",
      "user_city": "澎湖縣",
      "user_job": "金融商業",
      "user_edu": "學士",
      "user_email": "hkshlerin@example.org",
      "user_mrg": "已婚",
      "user_diet": "重肉食",
      "user_hbt": "健身保健"
    },
    {
      "id": 64,
      "user_name": "Mr. Adolf Kuhn II",
      "user_phone": "(841) 903-3759",
      "created_at": "2021-02-20T15:06:15+08:00",
      "user_birth": "1981-01-11",
      "user_gender": "女性",
      "user_city": "屏東縣",
      "user_job": "體育",
      "user_edu": "碩士以上",
      "user_email": "athena.kris@example.net",
      "user_mrg": "已婚",
      "user_diet": "環保素",
      "user_hbt": "科技"
    },
    {
      "id": 72,
      "user_name": "Tevin Emard",
      "user_phone": "+13132480503",
      "created_at": "2021-02-20T15:06:15+08:00",
      "user_birth": "2007-04-22",
      "user_gender": "男性",
      "user_city": "連江縣",
      "user_job": "建築營造",
      "user_edu": "碩士以上",
      "user_email": "swest@example.org",
      "user_mrg": "已婚",
      "user_diet": "不拘",
      "user_hbt": "購物時尚"
    },
    {
      "id": 75,
      "user_name": "Franz Gleichner",
      "user_phone": "+1-839-766-0461",
      "created_at": "2021-02-20T15:06:15+08:00",
      "user_birth": "2018-06-15",
      "user_gender": "其他",
      "user_city": "高雄市",
      "user_job": "餐旅服務",
      "user_edu": "碩士以上",
      "user_email": "phermiston@example.com",
      "user_mrg": "已婚",
      "user_diet": "不拘",
      "user_hbt": "音樂影視"
    },
    {
      "id": 82,
      "user_name": "Leanne Pollich",
      "user_phone": "+1-693-953-0604",
      "created_at": "2021-02-20T15:06:15+08:00",
      "user_birth": "1996-12-08",
      "user_gender": "男性",
      "user_city": "台南市",
      "user_job": "建築營造",
      "user_edu": "學士",
      "user_email": "bernita96@example.net",
      "user_mrg": "離異",
      "user_diet": "信仰素",
      "user_hbt": "購物時尚"
    }
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」建立外部活動

「品牌管理者」建立外部活動
POST/api/brand-manager/external-promotions

  • 422 欄位格式錯誤

  • 401 token 錯誤

  • tags 帶入 tag_id, 可經由 「品牌管理者」取得標籤 API 取得

Example URI

POST /api/brand-manager/external-promotions
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Body
{
  "name": "瓦城外部活動 2caf9c97-8c84-45f6-a54a-1b35b99d1a81",
  "url": "https://google.com",
  "tags": [
    "10",
    "11",
    "12"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 56
X-RateLimit-Limit: 60
phpdebugbar-id: X30510273bf7d9373332db93696d792d0
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created"
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: Xb150c8c9af5f56083c3d52d3f2bc28c1
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "url": [
      "The url format is invalid."
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

「品牌管理者」取得外部活動

「品牌管理者」取得外部活動
GET/api/brand-manager/external-promotions?name=promotion&created_at=2021-02-23

  • 401 表示 token 錯誤

  • 422 欄位格式錯誤

  • created_at 格式: Y-m-d

  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

  • sort: 排序欄位

    • 建立時間: created_at
  • direction: 排序規則, 預設 desc

    • desc (大至小, 新至舊)
    • asc (小至大, 舊至新)

Example URI

GET /api/brand-manager/external-promotions?name=promotion&created_at=2021-02-23
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 50
X-RateLimit-Limit: 60
phpdebugbar-id: X79f0f0fa722a29f8680adee7b99c5b9a
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 30,
      "name": "瓦城外部活動 94eafb5a-bb61-4f58-9def-e118cb1734bb",
      "url": "https://google.com",
      "short_url": "https://bit.ly/3qJW47G",
      "created_at": "2021-02-26T20:45:13+08:00",
      "tags": [
        {
          "id": 10,
          "name": "標籤 36cffcb5-f608-4623-9abc-6bbb4993d8db"
        },
        {
          "id": 11,
          "name": "標籤 d3d731fd-7ec9-4762-a7ca-ad3b740b783b"
        },
        {
          "id": 12,
          "name": "標籤 ca203db1-799a-4bd5-bf1a-ba9258dea8e8"
        }
      ]
    }
  ],
  "links": {
    "first": "http://echoss.test/api/brand-manager/external-promotions?created_at=2021-02-26&rows=3&direction=desc&sort=created_at&page=1",
    "last": "http://echoss.test/api/brand-manager/external-promotions?created_at=2021-02-26&rows=3&direction=desc&sort=created_at&page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/external-promotions?created_at=2021-02-26&rows=3&direction=desc&sort=created_at&page=1",
        "label": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http://echoss.test/api/brand-manager/external-promotions",
    "per_page": 3,
    "to": 1,
    "total": 1
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X95fb71d38a929201f36178266646f67d
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "created_at": [
      "The created at does not match the format Y-m-d."
    ]
  }
}

「品牌管理者」更新單一外部活動

「品牌管理者」更新單一外部活動
PUT/api/brand-manager/external-promotions/1

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

  • 403 表示權限不足

  • tags 帶入 tag_id, 可經由 「品牌管理者」取得標籤 API 取得

Example URI

PUT /api/brand-manager/external-promotions/1
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Body
{
  "name": "12314124",
  "url": "http://example.com",
  "tags": [
    "11",
    "12"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X84b14db210a3232a7fd54f897061d626
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X95fb71d38a929201f36178266646f67d
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "created_at": [
      "The created at does not match the format Y-m-d."
    ]
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}

「品牌管理者」取得核銷門市選項

「品牌管理者」取得核銷門市選項
GET/api/brand-manager/shops

  • 此 API 得出結果可帶入 「品牌管理者」取得外部活動票卷紀錄 API 的 shop_id

Example URI

GET /api/brand-manager/shops
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDA3MDY4OSwiZXhwIjoxNjE0Mjg2Njg5LCJuYmYiOjE2MTQwNzA2ODksImp0aSI6InhCR1BWSUhmcXVmbERmWlgiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.BtaEyigK-MGNKRBuWGitA045ivPgfBPTdVJbUucFC20
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X69a2a6fae6cff8060bc0a88a4147199f
Vary: Accept-Encoding
Body
[
  {
    "id": 1,
    "name": "測試1"
  },
  {
    "id": 3,
    "name": "4mqYdgDTI0NahSBucD"
  },
  {
    "id": 5,
    "name": "333321"
  },
  {
    "id": 6,
    "name": "X3LlilBF36XINC5MpYbk"
  },
  {
    "id": 12,
    "name": "JAF160HvAACsMegeh"
  },
  {
    "id": 13,
    "name": "33332112312"
  },
  {
    "id": 14,
    "name": "JiMXQCpgTzPjK3MfsFoV"
  }
]

「品牌管理者」取得外部優惠卷報表分頁

「品牌管理者」取得外部優惠卷報表分頁
GET/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=瓦城&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

  • 403 表示權限不足

  • 模糊搜尋:

    • voucher_name
  • 日期搜尋:格式 Y-m-d

    • sent_at
    • used_at
    • cancelled_at
  • 門市名稱搜尋帶入 shop_id, 由 「品牌管理者」取得核銷門市選項 API 取得 shop_id

  • 活動帶入 promotion_id

  • sort: 排序欄位

    • 獲得時間: sent_at
    • 使用時間: used_at
    • 取消時間: cancelled_at
    • 門市名稱: shop_name
  • direction: 排序規則, 預設 desc

    • desc (大至小, 新至舊)
    • asc (小至大, 舊至新)
  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

Example URI

GET /api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDI1ODIyMywiZXhwIjoxNjE0NDc0MjIzLCJuYmYiOjE2MTQyNTgyMjMsImp0aSI6ImFYSFBsSXdNUGJlRkUzb04iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.eaSxCZZER8TN_x5KOn2tgMe3rVEBzQOxplrxxVdCDNY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 54
X-RateLimit-Limit: 60
phpdebugbar-id: X6cc9645ea8c0395feb5ac73043f11cf3
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 68,
      "voucher_name": "瓦城 288元",
      "line_id": "1c46bdf2-80b3-48e4-a1b6-ce405d28be63",
      "sent_at": "2021-02-24T06:49:43+08:00",
      "used_at": "2021-02-24T06:49:43+08:00",
      "cancelled_at": "2021-02-24T06:49:43+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 69,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "40d139d8-d43c-4ac5-974a-6a8c41fea6b4",
      "sent_at": "2021-02-24T06:49:43+08:00",
      "used_at": "2021-02-24T06:49:43+08:00",
      "cancelled_at": "2021-02-24T06:49:43+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 70,
      "voucher_name": "瓦城 288元",
      "line_id": "07f951b9-2b9d-468b-a01e-5fe4fde4423e",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 71,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "f1f0b00d-cc0f-48c7-9e56-4eb70455f683",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 72,
      "voucher_name": "瓦城 288元",
      "line_id": "3be1349c-8086-405d-bc04-71c0cad029c9",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    }
  ],
  "links": {
    "first": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=1",
    "last": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=4",
    "prev": null,
    "next": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 4,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=1",
        "label": 1,
        "active": true
      },
      {
        "url": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=2",
        "label": 2,
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=3",
        "label": 3,
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=4",
        "label": 4,
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/voucher-statements?shop_id=18&sort=cancelled_at&direction=asc&rows=5&voucher_name=%E7%93%A6%E5%9F%8E&sent_at=2021-02-24&used_at=2021-02-24&cancelled_at=2021-02-24&promotion_id=2&page=2",
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http://echoss.test/api/brand-manager/voucher-statements",
    "per_page": 5,
    "to": 5,
    "total": 20
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X95fb71d38a929201f36178266646f67d
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "created_at": [
      "The created at does not match the format Y-m-d."
    ]
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}

「品牌管理者」取得所有外部活動優惠卷報表

「品牌管理者」取得所有外部活動優惠卷報表
GET/api/brand-manager/all-voucher-statements

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 可帶入 promotion_id 搜尋該場活動所有票卷

Example URI

GET /api/brand-manager/all-voucher-statements
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDE3NDI0MiwiZXhwIjoxNjE0MzkwMjQyLCJuYmYiOjE2MTQxNzQyNDIsImp0aSI6Ikx0NjRxSDluQzJFaUMybm8iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.wMiCwVINx1c-nSbGrR30r3F-7AawMFsd95lxZJq7V8w
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xa759b06d107357d7d905cfa27c0d7f0f
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 1,
      "voucher_name": "瓦城 288元",
      "line_id": "2ba5d23e-64ad-42db-8320-c5391386fa3c",
      "sent_at": "2021-02-24T06:49:18+08:00",
      "used_at": "2021-02-24T06:49:18+08:00",
      "cancelled_at": "2021-02-24T06:49:18+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 2,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "ec1ee1bc-949e-4c16-a641-a62402462a07",
      "sent_at": "2021-02-23T09:14:01+08:00",
      "used_at": "2021-02-23T09:14:01+08:00",
      "cancelled_at": "2021-02-23T09:14:01+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 24,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "d468a51f-266b-4b0a-a99b-e8f8faded90a",
      "sent_at": "2021-02-23T09:14:06+08:00",
      "used_at": "2021-02-23T09:14:06+08:00",
      "cancelled_at": "2021-02-23T09:14:06+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 26,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "3de0a1df-d7b3-4829-baae-5aa2c6e6d4d6",
      "sent_at": "2021-02-23T09:14:08+08:00",
      "used_at": "2021-02-23T09:14:08+08:00",
      "cancelled_at": "2021-02-23T09:14:08+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 28,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "c7e6f5b9-7564-486e-b115-0062c1d74488",
      "sent_at": "2021-02-23T09:14:09+08:00",
      "used_at": "2021-02-23T09:14:09+08:00",
      "cancelled_at": "2021-02-23T09:14:09+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 30,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "969e336f-cd2c-462c-95ef-06b55b8d1540",
      "sent_at": "2021-02-23T09:14:09+08:00",
      "used_at": "2021-02-23T09:14:09+08:00",
      "cancelled_at": "2021-02-23T09:14:09+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 32,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "a6368926-2599-4c72-8341-31fe7f389c00",
      "sent_at": "2021-02-23T09:14:11+08:00",
      "used_at": "2021-02-23T09:14:11+08:00",
      "cancelled_at": "2021-02-23T09:14:11+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 34,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "a8006058-30ce-4d42-b2d4-073472ba8830",
      "sent_at": "2021-02-23T09:14:12+08:00",
      "used_at": "2021-02-23T09:14:12+08:00",
      "cancelled_at": "2021-02-23T09:14:12+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 36,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "6b8a20a8-2e7d-4704-899e-9c9e57dd9624",
      "sent_at": "2021-02-23T09:14:13+08:00",
      "used_at": "2021-02-23T09:14:13+08:00",
      "cancelled_at": "2021-02-23T09:14:13+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 38,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "240dab87-b16a-4358-816e-86a12b8c7a1a",
      "sent_at": "2021-02-23T09:14:37+08:00",
      "used_at": "2021-02-23T09:14:37+08:00",
      "cancelled_at": "2021-02-23T09:14:37+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 40,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "0db8927f-4cc3-4508-8b78-1659ed0c3d11",
      "sent_at": "2021-02-23T09:14:41+08:00",
      "used_at": "2021-02-23T09:14:41+08:00",
      "cancelled_at": "2021-02-23T09:14:41+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 42,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "8038a398-0a97-4c22-b485-3d458fe8032a",
      "sent_at": "2021-02-23T09:14:42+08:00",
      "used_at": "2021-02-23T09:14:42+08:00",
      "cancelled_at": "2021-02-23T09:14:42+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 44,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "05b8ef35-dc6a-4232-a459-b4526efc0ec8",
      "sent_at": "2021-02-23T09:14:42+08:00",
      "used_at": "2021-02-23T09:14:42+08:00",
      "cancelled_at": "2021-02-23T09:14:42+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 46,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "d4b0f69a-d547-4850-820f-ec9368c08b34",
      "sent_at": "2021-02-23T09:14:43+08:00",
      "used_at": "2021-02-23T09:14:43+08:00",
      "cancelled_at": "2021-02-23T09:14:43+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 48,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "e0c0f2d5-949f-4f71-9965-9f8ecad84170",
      "sent_at": "2021-02-23T09:14:44+08:00",
      "used_at": "2021-02-23T09:14:44+08:00",
      "cancelled_at": "2021-02-23T09:14:44+08:00",
      "shop_name": "測試1"
    },
    {
      "id": 50,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "b6352308-50bd-4ee0-8861-42a799f6f8bb",
      "sent_at": "2021-02-24T06:49:18+08:00",
      "used_at": "2021-02-24T06:49:18+08:00",
      "cancelled_at": "2021-02-24T06:49:18+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 54,
      "voucher_name": "瓦城 288元",
      "line_id": "75407ed6-062e-4158-a830-15f5bcb3f3bb",
      "sent_at": "2021-02-24T06:49:31+08:00",
      "used_at": "2021-02-24T06:49:31+08:00",
      "cancelled_at": "2021-02-24T06:49:31+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 55,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "f40fa4e7-8af1-482b-af6a-f4791a68cd0b",
      "sent_at": "2021-02-24T06:49:31+08:00",
      "used_at": "2021-02-24T06:49:31+08:00",
      "cancelled_at": "2021-02-24T06:49:31+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 56,
      "voucher_name": "瓦城 288元",
      "line_id": "556d2253-5ffe-4981-bda3-3c7c9c97e804",
      "sent_at": "2021-02-24T06:49:34+08:00",
      "used_at": "2021-02-24T06:49:34+08:00",
      "cancelled_at": "2021-02-24T06:49:34+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 57,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "c0bb9408-b066-4128-9fb2-e0900f8be106",
      "sent_at": "2021-02-24T06:49:34+08:00",
      "used_at": "2021-02-24T06:49:34+08:00",
      "cancelled_at": "2021-02-24T06:49:34+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 58,
      "voucher_name": "瓦城 288元",
      "line_id": "52635f5e-b7a8-4059-8f83-0a018af3f52f",
      "sent_at": "2021-02-24T06:49:34+08:00",
      "used_at": "2021-02-24T06:49:34+08:00",
      "cancelled_at": "2021-02-24T06:49:34+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 59,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "92dee706-57ab-4649-97f2-0168bd92bf32",
      "sent_at": "2021-02-24T06:49:34+08:00",
      "used_at": "2021-02-24T06:49:34+08:00",
      "cancelled_at": "2021-02-24T06:49:34+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 60,
      "voucher_name": "瓦城 288元",
      "line_id": "f32a9248-9d0e-4f2d-8396-ec4380be44b3",
      "sent_at": "2021-02-24T06:49:35+08:00",
      "used_at": "2021-02-24T06:49:35+08:00",
      "cancelled_at": "2021-02-24T06:49:35+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 61,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "4ec95df6-40f6-488f-918b-ad5af445d569",
      "sent_at": "2021-02-24T06:49:35+08:00",
      "used_at": "2021-02-24T06:49:35+08:00",
      "cancelled_at": "2021-02-24T06:49:35+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 62,
      "voucher_name": "瓦城 288元",
      "line_id": "352f8401-dd1d-4451-86ca-0ba49091cb9d",
      "sent_at": "2021-02-24T06:49:36+08:00",
      "used_at": "2021-02-24T06:49:36+08:00",
      "cancelled_at": "2021-02-24T06:49:36+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 63,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "641c2408-5691-429c-adf2-49337fa4e829",
      "sent_at": "2021-02-24T06:49:36+08:00",
      "used_at": "2021-02-24T06:49:36+08:00",
      "cancelled_at": "2021-02-24T06:49:36+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 64,
      "voucher_name": "瓦城 288元",
      "line_id": "3d71d0a2-73c2-41e5-ad73-28d98c9eb2e8",
      "sent_at": "2021-02-24T06:49:36+08:00",
      "used_at": "2021-02-24T06:49:36+08:00",
      "cancelled_at": "2021-02-24T06:49:36+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 65,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "30d09e7b-ef19-45c1-857a-902aba020d2a",
      "sent_at": "2021-02-24T06:49:36+08:00",
      "used_at": "2021-02-24T06:49:36+08:00",
      "cancelled_at": "2021-02-24T06:49:36+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 66,
      "voucher_name": "瓦城 288元",
      "line_id": "9ce8f812-0969-4217-b155-4c912650a708",
      "sent_at": "2021-02-24T06:49:37+08:00",
      "used_at": "2021-02-24T06:49:37+08:00",
      "cancelled_at": "2021-02-24T06:49:37+08:00",
      "shop_name": "btw2AhFeCAqJ4SVyb"
    },
    {
      "id": 67,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "0faf0474-a8eb-4b42-a2a6-d221ad36f57d",
      "sent_at": "2021-02-24T06:49:37+08:00",
      "used_at": "2021-02-24T06:49:37+08:00",
      "cancelled_at": "2021-02-24T06:49:37+08:00",
      "shop_name": "SHjtFd7g9PukvR"
    },
    {
      "id": 68,
      "voucher_name": "瓦城 288元",
      "line_id": "1c46bdf2-80b3-48e4-a1b6-ce405d28be63",
      "sent_at": "2021-02-24T06:49:43+08:00",
      "used_at": "2021-02-24T06:49:43+08:00",
      "cancelled_at": "2021-02-24T06:49:43+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 69,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "40d139d8-d43c-4ac5-974a-6a8c41fea6b4",
      "sent_at": "2021-02-24T06:49:43+08:00",
      "used_at": "2021-02-24T06:49:43+08:00",
      "cancelled_at": "2021-02-24T06:49:43+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 70,
      "voucher_name": "瓦城 288元",
      "line_id": "07f951b9-2b9d-468b-a01e-5fe4fde4423e",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 71,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "f1f0b00d-cc0f-48c7-9e56-4eb70455f683",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 72,
      "voucher_name": "瓦城 288元",
      "line_id": "3be1349c-8086-405d-bc04-71c0cad029c9",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 73,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "25d7dc31-42da-430a-819e-709c1717b27a",
      "sent_at": "2021-02-24T06:49:44+08:00",
      "used_at": "2021-02-24T06:49:44+08:00",
      "cancelled_at": "2021-02-24T06:49:44+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 74,
      "voucher_name": "瓦城 288元",
      "line_id": "c2798d0f-506c-424e-b505-509011f9d313",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 75,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "89c68310-40e5-4b16-9f0e-bd062257fa27",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 76,
      "voucher_name": "瓦城 288元",
      "line_id": "36512efa-5843-4c4c-b8cf-15719f400b4a",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 77,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "edfd8b99-765b-4147-b7d0-eaa747e530b4",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 78,
      "voucher_name": "瓦城 288元",
      "line_id": "6578cb66-944f-4837-94ba-ca4347b4fde7",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 79,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "18d01fc2-815a-4ca9-bc13-17ff0efcd511",
      "sent_at": "2021-02-24T06:49:45+08:00",
      "used_at": "2021-02-24T06:49:45+08:00",
      "cancelled_at": "2021-02-24T06:49:45+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 80,
      "voucher_name": "瓦城 288元",
      "line_id": "b0ffb4f4-d9bf-4704-a965-24cfa7975796",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 81,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "f4a32c48-cc9b-452f-9b75-9302791bc27b",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 82,
      "voucher_name": "瓦城 288元",
      "line_id": "538e289c-1ab8-4555-a578-7f70b86f6066",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 83,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "c12caa6a-832b-4c66-8f65-8d32b2958e67",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 84,
      "voucher_name": "瓦城 288元",
      "line_id": "68d0e801-624b-4965-ad39-e3a21a0c8e2c",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 85,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "18f0d732-0422-44ef-acc0-4f4cc5646fbb",
      "sent_at": "2021-02-24T06:49:46+08:00",
      "used_at": "2021-02-24T06:49:46+08:00",
      "cancelled_at": "2021-02-24T06:49:46+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 86,
      "voucher_name": "瓦城 288元",
      "line_id": "4fbdfb3f-6e47-4e96-bb37-ee54f800ff24",
      "sent_at": "2021-02-24T06:49:47+08:00",
      "used_at": "2021-02-24T06:49:47+08:00",
      "cancelled_at": "2021-02-24T06:49:47+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 87,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "9901dc7c-683c-43cf-8065-9af272904924",
      "sent_at": "2021-02-24T06:49:47+08:00",
      "used_at": "2021-02-24T06:49:47+08:00",
      "cancelled_at": "2021-02-24T06:49:47+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 88,
      "voucher_name": "瓦城 288元",
      "line_id": "ed753a16-ab91-4766-b2af-dd1516f0e035",
      "sent_at": "2021-02-25T10:46:02+08:00",
      "used_at": "2021-02-25T10:46:02+08:00",
      "cancelled_at": "2021-02-25T10:46:02+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 89,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "e98cb81b-8af4-45c4-8c57-c6c1502a9815",
      "sent_at": "2021-02-25T10:46:02+08:00",
      "used_at": "2021-02-25T10:46:02+08:00",
      "cancelled_at": "2021-02-25T10:46:02+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 90,
      "voucher_name": "瓦城 288元",
      "line_id": "ba1fc5c5-ec6b-4208-a587-6b75101afb0e",
      "sent_at": "2021-02-25T10:46:37+08:00",
      "used_at": "2021-02-25T10:46:37+08:00",
      "cancelled_at": "2021-02-25T10:46:37+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    },
    {
      "id": 91,
      "voucher_name": "瓦城 288元 平日好運金",
      "line_id": "f9a6bc34-2b1f-4895-8d04-e849ff60c7cd",
      "sent_at": "2021-02-25T10:46:37+08:00",
      "used_at": "2021-02-25T10:46:37+08:00",
      "cancelled_at": "2021-02-25T10:46:37+08:00",
      "shop_name": "l3k6d6yn06nG7BwbSME"
    }
  ]
}

「品牌管理者」建立標籤

「品牌管理者」建立標籤
POST/api/brand-manager/tags

  • 標籤名稱在同品牌下是 unique 的

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

  • 403 表示權限不足

Example URI

POST /api/brand-manager/tags
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDI1ODIyMywiZXhwIjoxNjE0NDc0MjIzLCJuYmYiOjE2MTQyNTgyMjMsImp0aSI6ImFYSFBsSXdNUGJlRkUzb04iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.eaSxCZZER8TN_x5KOn2tgMe3rVEBzQOxplrxxVdCDNY
Body
{
  "name": "標籤 2872a767-d6c7-4dd6-b296-8b97ea0a7da7"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: Xf7dab596bda20502cc779511512747d9
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X4c51f372367efc814f6dff0346350f3f
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name has already been taken."
    ]
  }
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}

「品牌管理者」取得標籤

「品牌管理者」取得標籤
GET/api/brand-manager/tags?name=1&rows=111

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 422 表示欄位格式錯誤

  • rows 若沒帶, 預設一頁 20 筆

  • rows 最多 100 筆, 若 rows 大於 100 也只顯示 100 筆

  • 模糊搜尋欄位

    • name

Example URI

GET /api/brand-manager/tags?name=1&rows=111
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDI1ODIyMywiZXhwIjoxNjE0NDc0MjIzLCJuYmYiOjE2MTQyNTgyMjMsImp0aSI6ImFYSFBsSXdNUGJlRkUzb04iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.eaSxCZZER8TN_x5KOn2tgMe3rVEBzQOxplrxxVdCDNY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X344248896ffd777f05a32c9999d95c2b
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 2,
      "name": "標籤 5341e19b-243a-4a77-84e5-5a992d8f9177"
    }
  ],
  "links": {
    "first": "http://echoss.test/api/brand-manager/tags?name=1&rows=111&page=1",
    "last": "http://echoss.test/api/brand-manager/tags?name=1&rows=111&page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://echoss.test/api/brand-manager/tags?name=1&rows=111&page=1",
        "label": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http://echoss.test/api/brand-manager/tags",
    "per_page": 100,
    "to": 1,
    "total": 1
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X8fe1b49b8f02c384bf01b0b97c5ec3d6
X-RateLimit-Remaining: 58
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "rows": [
      "The rows must be an integer."
    ]
  }
}

「品牌管理者」刪除標籤

「品牌管理者」刪除標籤
DELETE/api/brand-manager/tags/2

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 404 表示該標籤不存在

Example URI

DELETE /api/brand-manager/tags/2
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDI1ODIyMywiZXhwIjoxNjE0NDc0MjIzLCJuYmYiOjE2MTQyNTgyMjMsImp0aSI6ImFYSFBsSXdNUGJlRkUzb04iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.eaSxCZZER8TN_x5KOn2tgMe3rVEBzQOxplrxxVdCDNY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 56
X-RateLimit-Limit: 60
phpdebugbar-id: X7be76a8cb92591f2194fa023f39d3f4a
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully deleted"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\Tag] 1"
}

「品牌管理者」更新標籤

「品牌管理者」更新標籤
PATCH/api/brand-manager/tags/6

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 404 表示該 tag 不存在

  • 422 表示欄位格式錯誤

Example URI

PATCH /api/brand-manager/tags/6
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDI1ODIyMywiZXhwIjoxNjE0NDc0MjIzLCJuYmYiOjE2MTQyNTgyMjMsImp0aSI6ImFYSFBsSXdNUGJlRkUzb04iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.eaSxCZZER8TN_x5KOn2tgMe3rVEBzQOxplrxxVdCDNY
Body
{
  "name": "標籤"
}
Response  200
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\Tag] 1"
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X4c51f372367efc814f6dff0346350f3f
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name has already been taken."
    ]
  }
}

「品牌管理者」更新品牌使用者條款

「品牌管理者」更新品牌使用者條款
PATCH/api/brand-manager/brands/1

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 422 表示欄位格式錯誤

  • 404 表示該品牌不存在

  • 若要清除所有內容, 請帶 null

Example URI

PATCH /api/brand-manager/brands/1
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Body
{
  "user_agreement": "434ad716-e617-4bcd-aa55-acda1b192f26"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X1915fac704b2cba821f4344689cf9085
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\Brand] 1"
}

「品牌管理者」取得單一品牌資訊

「品牌管理者」取得單一品牌資訊
GET/api/brand-manager/brands/1

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 404 表示該品牌不存在

  • 422 表示欄位格式錯誤

  • 品牌 id 可經由 「品牌管理者」取得品牌管理者 / 門市管理者自身資料 API 獲得

Example URI

GET /api/brand-manager/brands/1
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X53c6955cef269c78fc999cf74f653063
Vary: Accept-Encoding
Body
{
  "data": {
    "id": 1,
    "name": "測試1",
    "liff_id": "446df120-50c5-4ae7-a6f6-469a451ca337",
    "user_agreement": "1",
    "required_registration_toggles": {
      "id": 1,
      "user_phone": 1,
      "user_name": 1,
      "user_birth": 2,
      "user_email": 2,
      "user_gender": 2,
      "user_city": 1,
      "user_job": 2,
      "user_edu": 2,
      "user_mrg": 2,
      "user_hbt": 1,
      "user_diet": 2
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\Brand] 1"
}

「品牌管理者」取得所有標籤

「品牌管理者」取得所有標籤
GET/api/brand-manager/all-tags

  • 401 表示 token 錯誤

  • 403 表示權限不足

Example URI

GET /api/brand-manager/all-tags
Request
HideShow
Headers
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDMyMjE0NCwiZXhwIjoxNjE0NTM4MTQ0LCJuYmYiOjE2MTQzMjIxNDQsImp0aSI6IjNid01abEFzaFNDVkNlTU4iLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.MobbMaGG4NMqUViOHQZAmkLCtlMJlsN6z2BJ3iazRLY
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X7a538ab9f16ead7759c7028d7c97cd3a
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 10,
      "name": "標籤 36cffcb5-f608-4623-9abc-6bbb4993d8db"
    },
    {
      "id": 11,
      "name": "標籤 d3d731fd-7ec9-4762-a7ca-ad3b740b783b"
    },
    {
      "id": 12,
      "name": "標籤 ca203db1-799a-4bd5-bf1a-ba9258dea8e8"
    },
    {
      "id": 13,
      "name": "標籤 1a648712-9c35-4599-865c-36dc7355f452"
    },
    {
      "id": 14,
      "name": "標籤 1b81f7a3-cc94-43cb-9365-ec5d8cb4efb2"
    }
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}

「品牌管理者」建立會員卡

「品牌管理者」建立會員卡
POST/api/brand-manager/member-cards

  • 同品牌的 name 為 unique

  • 等級 1 的會員卡, lowest_amount 需 >= 0

  • 非等級 1 的會員卡, lowest_amount 需 > 上一個 level 的 lowest_amount + 1

  • 會員卡一律往後新增, 即等級 1 -> 等級 2 -> 等級 3

  • 一個品牌下最多 5 張會員卡

  • 以下為 required 欄位

    • name
    • lowest_amount
  • image 限定為 jpeg, png, 大小為 1.5M

Example URI

POST /api/brand-manager/member-cards
Request
HideShow
Headers
Content-Type: multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDk1NzM3MiwiZXhwIjoxNjE1MTczMzcyLCJuYmYiOjE2MTQ5NTczNzIsImp0aSI6ImpJTXNUNGNZNld2VldxS0YiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.8EpsEy4Eg4NmnglmCF4prF1FZh_RG1lFo-Fzu_zeXug
Body
--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="name"

83d5d410-d498-4da1-aa7a-6697d70e8eec

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="benefit"

test

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="lowest_amount"

50013

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="highest_amount"

50014

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="image"

fileHere

--__X_PAW_BOUNDARY__--
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X793f770c4766546d6dd02de7867ca897
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully created."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X4c51f372367efc814f6dff0346350f3f
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name has already been taken."
    ]
  }
}

「品牌管理者」刪除會員卡

「品牌管理者」刪除會員卡
DELETE/api/brand-manager/member-cards/18

  • 400 表示試圖刪除 level 1 會員卡

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 404 表示未找到該會員卡

  • level 1 會員卡不可被刪除

  • 當移除的卡片為 level 2 時, level 3 的 lowest_amount 會自動調整為被刪除的 level 2 的 lowest_amount

  • 當移除的卡片為 level 2 時, level 3 的 level 自動調整為 level 2, level 4 的 level 自動調整為 level 3, 往上依此類推

Example URI

DELETE /api/brand-manager/member-cards/18
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDk1NzM3MiwiZXhwIjoxNjE1MTczMzcyLCJuYmYiOjE2MTQ5NTczNzIsImp0aSI6ImpJTXNUNGNZNld2VldxS0YiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.8EpsEy4Eg4NmnglmCF4prF1FZh_RG1lFo-Fzu_zeXug
Body
{}
Response  200
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "data": {
    "message": "Successfully deleted."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\MemberCard] 20"
}

「品牌管理者」更新會員卡

「品牌管理者」更新會員卡
PATCH/api/brand-manager/member-cards/23

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 404 表示未找到該會員卡

  • 422 表示欄位格式錯誤

  • 同品牌下, name 為 unique

  • 因 HTTP FORM 不支援 PUT, PATCH, 所以請使用 POST, 並在欄位 _method 帶入 PATCH

  • 假如 level 1 的 lowest_amount = 0, level 2 的 lowest_amount = 5000, level 3 = 10000

    • 當我 update level 1 的 lowest_amount 時
      • 不可 < 0
      • 不可 > level 2 的 lowest_amount - 1
    • 當我 update level 2 的 lowest_amount 時
      • 不可 < level 1 的 lowest_amount + 1
      • 不可 > level 3 的 lowest_amount - 1
  • optional 欄位

    • name
    • benefit
    • lowest_amount
    • image

Example URI

PATCH /api/brand-manager/member-cards/23
Request
HideShow
Headers
Content-Type: multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDk1NzM3MiwiZXhwIjoxNjE1MTczMzcyLCJuYmYiOjE2MTQ5NTczNzIsImp0aSI6ImpJTXNUNGNZNld2VldxS0YiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.8EpsEy4Eg4NmnglmCF4prF1FZh_RG1lFo-Fzu_zeXug
Body
--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="name"

9cff7503-f4f0-46cf-a222-3f94c82431e4

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="benefit"

test

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="lowest_amount"

2

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="highest_amount"

3

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="image"

身分證

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="_method"

PATCH

--__X_PAW_BOUNDARY__

Content-Disposition: form-data; name="delete_image"

1

--__X_PAW_BOUNDARY__--
Response  200
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\MemberCard] 20"
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X4c51f372367efc814f6dff0346350f3f
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name has already been taken."
    ]
  }
}

「品牌管理者」取得會員卡

「品牌管理者」取得會員卡
GET/api/brand-manager/member-cards

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 最後一張會員卡, highest_amount 連 key 都不會帶

Example URI

GET /api/brand-manager/member-cards
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9icmFuZC1tYW5hZ2VyXC9sb2dpbiIsImlhdCI6MTYxNDk1NzM3MiwiZXhwIjoxNjE1MTczMzcyLCJuYmYiOjE2MTQ5NTczNzIsImp0aSI6ImpJTXNUNGNZNld2VldxS0YiLCJzdWIiOjEsInBydiI6IjY5ZjNkMTAyNTc4NGIxMzEzNDhjOTdjM2QwMTljMGZjYjUxYjI4OWYifQ.8EpsEy4Eg4NmnglmCF4prF1FZh_RG1lFo-Fzu_zeXug
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X3711536037b11d9fb77e43de5835a2f6
Vary: Accept-Encoding
Body
{
  "data": [
    {
      "id": 26,
      "name": "3fe6e7e2-6614-4dc3-87b5-ee3ebe386640",
      "benefit": "test",
      "lowest_amount": 50,
      "highest_amount": 250,
      "level": 1,
      "image": null
    }
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}

會員

「會員」登入

「會員」登入
POST/api/member/login

  • 401 表示 token 錯誤

  • 422 表示欄位格式錯誤

    • 缺少該帶的欄位
  • 404 表示

    • user 不存在
    • 品牌 不存在
  • Header 請帶 LINE id_token

  • 流程圖

Example URI

POST /api/member/login
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0dGVzdCJ9.eYuB2rM5zGjOKbaA5dpFLiz2h2o5lpsJHuhC6sTex_k
Body
{
  "brand_id": 9
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X31a1cb22cfd87c940cb381e7c73e3ea9
Vary: Accept-Encoding
Body
{
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9tZW1iZXJcL2xvZ2luIiwiaWF0IjoxNjEyNzYxNjYwLCJleHAiOjE2MTI5Nzc2NjAsIm5iZiI6MTYxMjc2MTY2MCwianRpIjoibUpSZ28ydGhqWEQ2Z214NyIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Kyn0xnnhwFoIFHqsiw8WxPFq1cPupQ0Fxfi7abcmb-w",
    "token_type": "bearer",
    "expires_in": 216000
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
Body
{
  "message": "Token Signature could not be verified."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "brand_id": [
      "The brand id field is required."
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\brand] 8"
}

「會員」取得品牌資訊

「會員」取得品牌資訊
GET/api/member/brands/Ifg3qGOPVOOaC

  • 請在 URL 帶入 brand identifier

Example URI

GET /api/member/brands/Ifg3qGOPVOOaC
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X3ae7a7d644d7fb5181e111a64b51d4fd
Vary: Accept-Encoding
Body
{
  "data": {
    "id": 1,
    "name": "測試1",
    "liff_id": "446df120-50c5-4ae7-a6f6-469a451ca337",
    "user_agreement": "1",
    "required_registration_toggles": {
      "id": 1,
      "user_phone": 1,
      "user_name": 1,
      "user_birth": 2,
      "user_email": 2,
      "user_gender": 2,
      "user_city": 1,
      "user_job": 2,
      "user_edu": 2,
      "user_mrg": 2,
      "user_hbt": 1,
      "user_diet": 2
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 56
Body
{
  "message": "No query results for model [App\\Models\\brand]."
}

「會員」註冊

「會員」註冊
POST/api/member/register

  • 以下 input 須符合規範值

    • user_gender
    • user_city
    • user_job
    • user_edu
    • user_mrg
    • user_hbt
    • user_diet
  • user_phone

    • 須符合台灣手機號碼格式
    • 同品牌下不可重複
  • user_birth 格式為 ‘Y-m-d’

  • user_email 同品牌下不可重複

  • 該 user line_id 同品牌下不可重複

  • 401 為 token 錯誤

  • 404 為該 brand 不存在

  • 422 為欄位驗證錯誤

Example URI

POST /api/member/register
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: Bearer eyJraWQiOiJjY2Q1OGMyZjI2NDZmNDVmZTBiNGJiYjAyMzdkNjJmMGRkN2JiMTY2OWQ0MGMxMjFiODQ4OGYxMGJmMzYzOTAwIiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiJodHRwczovL2FjY2Vzcy5saW5lLm1lIiwic3ViIjoiVTdjMGUzNzkyNzU3MjQyYTViZWYxM2Q0MzY3ZDM1ZWNlIiwiYXVkIjoiMTY1NTY0Nzc5MyIsImV4cCI6MTYxMjk1MjQxOCwiaWF0IjoxNjEyOTQ4ODE4LCJhbXIiOlsibGluZXNzbyJdLCJuYW1lIjoiS2VubmVkeSIsInBpY3R1cmUiOiJodHRwczovL3Byb2ZpbGUubGluZS1zY2RuLm5ldC8waEJLeGtBNU9MSFdSRkVqU0RUcmxpTTNsWEV3a3lQQnNzUFhCVkJtbEFRVkpyS3dvMGNTY0dBMmhIRVFkb0pscGljQ1JTQURVV1FnRV8ifQ.2X_-o2XxT6KzZPs7TJWA8YL32JicnXtrnhUUiutVdoLFHQIom-zU69UdZGAfNZUXKxQ_TS1lb6oapyjcyW_O1A
Body
{
  "user_birth": "1987-02-03",
  "user_phone": "0963284338",
  "user_phone_confirmation": "0963284338",
  "user_email": "tn710617@gmail.com",
  "user_name": "哈哈哈",
  "user_gender": "男性",
  "user_city": "台南市",
  "user_job": "自由業",
  "user_edu": "國中以下",
  "user_mrg": "未婚",
  "user_hbt": "戶外活動",
  "user_diet": "重肉食",
  "brand_id": "2"
}
Response  200
HideShow
Headers
Content-Type: text/html; charset=UTF-8
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 58
X-RateLimit-Limit: 60
phpdebugbar-id: X5c03941cc4e03cd815330ce32bda3847
Vary: Accept-Encoding
Body
unique:users,line_id,NULL,id,brand_id,"2"
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Body
{
  "message": "Invalid token"
}
Response  404
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 58
Body
{
  "message": "No query results for model [App\\Models\\Brand] 3"
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "brand_id": [
      "The brand id field is required."
    ]
  }
}

「會員」更新自身資訊

「會員」更新自身資訊
PATCH/api/member/me

  • 401 表示 token 錯誤

  • 403 表示權限不足

  • 422 表示欄位格式錯誤

Example URI

PATCH /api/member/me
Request
HideShow
Headers
Content-Type: application/json; charset=utf-8
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9lY2hvc3MudGVzdFwvYXBpXC9tZW1iZXJcL2xvZ2luIiwiaWF0IjoxNjE0NDA3MDQ1LCJleHAiOjE2MTQ2MjMwNDUsIm5iZiI6MTYxNDQwNzA0NSwianRpIjoiNGJsZzVNUThhZmFRVElxNCIsInN1YiI6MjAsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.Pq_d98qIWMfD96cilWS9M47F07sOXE9pFQLfue25nKw
Body
{
  "user_phone": "0963284338",
  "user_email": "tn710617@gmail.com",
  "user_name": "12312",
  "user_birth": "1977-02-01",
  "user_city": "臺北市",
  "user_gender": "男性",
  "user_diet": "重肉食",
  "user_mrg": "未婚",
  "user_hbt": "科技",
  "user_job": "學生",
  "user_edu": "國中以下"
}
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X59426067449a1dbeed50452de5ce1614
Vary: Accept-Encoding
Body
{
  "data": {
    "message": "Successfully updated."
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}
Response  403
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Vary: Accept-Encoding
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
X-RateLimit-Limit: 60
Transfer-Encoding: chunked
X-RateLimit-Remaining: 59
Body
{
  "message": "This action is unauthorized."
}
Response  422
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Cache-Control: no-cache, private
Transfer-Encoding: chunked
X-RateLimit-Limit: 60
phpdebugbar-id: X95fb71d38a929201f36178266646f67d
X-RateLimit-Remaining: 59
Body
{
  "message": "The given data was invalid.",
  "errors": {
    "created_at": [
      "The created at does not match the format Y-m-d."
    ]
  }
}

「會員」取得自身資訊

「會員」取得自身資訊
GET/api/member/me

  • 401 表示 token 錯誤

Example URI

GET /api/member/me
Request
HideShow
Headers
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTUxMjQ2NzQsImV4cCI6MTYxNTEyNDczNCwic3ViIjoiOTIxIn0.VBJ1rZrE7fjrq3oA0fd-qT7ZqjXExSxN9y0I83iCPNo
Response  200
HideShow
Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
X-Powered-By: PHP/7.4.13
Transfer-Encoding: chunked
Cache-Control: no-cache, private
X-RateLimit-Remaining: 59
X-RateLimit-Limit: 60
phpdebugbar-id: X87c9dc8daf93ab227449b8a1ad549d1c
Vary: Accept-Encoding
Body
{
  "data": {
    "id": 921,
    "user_name": "哈哈哈",
    "user_phone": "0942013314",
    "created_at": "2021-03-07T21:24:06+08:00",
    "line_id": "fjekwlafjewkla",
    "user_birth": null,
    "user_gender": "男性",
    "user_city": "臺南市",
    "user_job": "自由業",
    "user_edu": null,
    "user_email": null,
    "user_mrg": null,
    "user_diet": null,
    "user_hbt": null,
    "tags": [],
    "member_card": {
      "id": 26,
      "name": "3fe6e7e2-6614-4dc3-87b5-ee3ebe386640",
      "benefit": null,
      "lowest_amount": 0,
      "highest_amount": 250,
      "level": 1,
      "image": null
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
X-Powered-By: PHP/7.4.13
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Cache-Control: no-cache, private
Body
{
  "message": "Unauthenticated."
}

Generated by aglio on 10 Apr 2021