MantaGO
  • 文件說明
  • 文件說明
    • 會員API
      • 帳號綁定
      • 解除帳號綁定
      • 會員列表
      • 會員資料
    • 用戶推播
    • 設定webview網址
    • 設定回呼網址
    • API Token與Secret Key換發
  • 常見問題
    • 如何取得Token
    • 錯誤代碼
  • 情境範例
    • 購物車下單後推播訊息
Powered by GitBook
On this page
  1. 文件說明
  2. 會員API

會員列表

用來取得所屬於某機器人的會員資料,並可依據參數,獲得特定之會員資料

Request Url :

POST https://mantago.cc/api/openapi/clients

Request headers :

Name
Description

Content-Type

application/json

Authorization

Bearer {API Token}

Request body:

Name
Type
Description
Required

secret

String

API Secret

O

Query parameter :

Name
Type
Description
Required

botId

String

經過加密的機器人ID

O

customerId

String

客戶ID

platform

String

line或是facebook

name

String

客戶名稱

limit

Integer

一次只取得幾筆資料(預設10筆)

offset

Integer

略過幾筆資料(預設0筆)

startAt

Integer

區間的起始時間,用於篩選會員資料創始時間。13碼的timestamp,EX: 1657867028700

endAt

Integer

區間的終點時間,用於篩選會員資料創始時間。13碼的timestamp,EX: 1657867028700

next

String

用以取得超出limit限制的剩餘資料;如果有這類的資料,可以從Request body內的clientList取得本參數。

Response Result:

Name
Type
Description

success

Boolean

表示取得資料成功與否

message

String

表示成功取得資料與否之訊息

clientList

Object

會員及後續資料

clientList:

Name
Type
Description

list

Array[Object]

會員資料

next

String

用來取得後續會員資料的變數

list:

Name
Type
Description

clientId

String

會員的 LINE / FB Messenger / Instagram ID

clientName

String

會員的 LINE / FB Messenger / Instagram 名稱

clientHeadshot

String

會員的大頭貼

platform

String

會員帳號所屬平台:line / facebook / instagram

remark

Array[Object]

會員的備註

isBlock

Boolean

該帳號是否主動封鎖機器人

customerId

String

客戶ID

userName

String

會員設定之名稱

userEmail

String

會員設定之Email

userPhone

String

會員設定之電話

userBirthday

String

會員設定之生日

userAddress

String

會員設定之地址

createdAt

Date

會員資料建立時間

updatedAt

Date

會員資料最後更新時間

lastInteractAt

Date

會員上次與機器人互動之時間

autoTags

Array[Object]

會員自動標籤

tags

Array[Object]

會員手動標籤

tourTags

Array[Object]

會員預約標籤

personalTags

Array[Object]

會員個性標籤

remark:

Name
Type
Description

text

String

備註內容

dateTime

Date

備註建立時間

autoTags:

Name
Type
Description

name

String

標籤名稱

createdAt

Date

標籤建立時間

tags

Name
Type
Description

name

String

標籤名稱

createdAt

Date

標籤建立時間

tourTags

Name
Type
Description

name

String

標籤名稱

createdAt

Date

標籤建立時間

personalTags

Name
Type
Description

name

String

標籤名稱

createdAt

Date

標籤建立時間

Response example :

取得第一部分資料

URL:

POST https://mantago.cc/api/openapi/clients?botId="thisIsMyId"

結果:

{
    "success": true,
    "message": "Get client list successfully",
    "clientList": {
        "list": [
            {
                "clientId": "1234567890ABCDEFG",
                "clientName": "小魟魚",
                "clientHeadshot": "https://this.is.headshot.com.tw",
                "platform": "line",
                "remark": [
                    {
                        "text": "可愛的小魟魚",
                        "dateTime": "2022-07-12T13:43:10.079Z"
                    }
                ],
                "isBlock": false,
                "customerId": "12345678",
                "userName": "魟小魚",
                "userEmail": "myEmail@mantago.cc",
                "userPhone": "0912-345-678",
                "userBirthday": "2020-02-20",
                "userAddress": "999 太平洋市魟魚區小魟魚路1號1樓",
                "createdAt": "2022-06-13T07:06:26.321Z",
                "updatedAt": "2022-07-18T09:25:44.242Z",
                "lastInteractAt": "2022-07-18T07:12:18.569Z",
                "autoTags": [
                    {
                        "name": "可愛",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    },
                    {
                        "name": "害羞",
                        "createdAt": "2022-07-12T03:16:00.598Z"
                    }
                ],
                "tags": [
                    {
                        "name": "小",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ],
                "tourTags": [
                    {
                        "name": "太平洋",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ],
                "personalTags": [
                    {
                        "name": "甜",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ]
            }
        ],
        "next": "VTJGc2RHVmtYMThVYkpmaWVveldPTWJ1UEp1bk5oMXl5cEZ4QnJzdW8vcGtENUtWTmEyVWZsQ2xrbEFURElGcQ=="
    }
}

取得第二部分資料

URL:

POST https://mantago.cc/api/openapi/clients?botId="thisIsMyId"&next="VTJGc2RHVmtYMThVYkpmaWVveldPTWJ1UEp1bk5oMXl5cEZ4QnJzdW8vcGtENUtWTmEyVWZsQ2xrbEFURElGcQ=="

結果:

{
    "success": true,
    "message": "Get client list successfully",
    "clientList": {
        "list": [
            {
                "clientId": "1234567890",
                "clientName": "大魟魚",
                "clientHeadshot": "https://this.is.headshot.com.tw",
                "platform": "facebook",
                "remark": null,
                "isBlock": false,
                "customerId": "321",
                "userName": 魟大魚,
                "userEmail": "yourEmail@mantago.cc",
                "userPhone": "0987-654-321",
                "userBirthday": "2000-01-31",
                "userAddress": "999 太平洋市魟魚區大魟魚路2號2樓",
                "createdAt": "2022-07-18T07:38:22.761Z",
                "updatedAt": "2022-07-18T09:28:20.887Z",
                "lastInteractAt": "2022-07-18T09:28:20.874Z",
                "autoTags": [
                    {
                        "name": "強壯",
                        "createdAt": "2022-06-23T05:30:52.557Z"
                    }
                ],
                "tags": [
                    {
                        "name": "大",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ],
                "tourTags": [
                    {
                        "name": "大西洋",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ],
                "personalTags": [
                    {
                        "name": "酷",
                        "createdAt": "2022-07-12T03:16:06.819Z"
                    }
                ]
            }
        ],
        "next": "VTJGc2RHVmtYMTltT3k0NWVYV1piVXZnVzNDdm5PWThjcXpDT1RpUVovVllxUWo4Zm90dmlXdzRzTlBLcnVlVQ=="
    }
}
Previous解除帳號綁定Next會員資料

Last updated 8 months ago