---
tags: OpenAPI
---
Crescendo Lab API reference
===
> last updated date: 2021/01/16
:::danger
This document is no longer updated, please refer to
https://cresclab.docs.apiary.io/
:::
:::info
We strongly advise using below OpenAPI in server-side.
:::
# HOST
`https://api.cresclab.com`
# **Member Data**
## **Get member profile** <span style="color: green">(Online)</span>
Search member data by any parameter. Or set empty parameter to get all member data.
>#### **HTTP request**
`GET /openapi/v1/member/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
> **Query parameters**
| Parameter | Required | Description |
| :-- | :-- | :-- |
|member_id| Optional | ID of member
|line_uid| Optional | LINE user id of member
|customer_id| Optional | The id bound on the member in MAAC
|email| Optional | Email of member
|mobile| Optional | Mobile of member
|status| Optional | **follow**: user has added your LINE official account as a friend<br/>**auth**: user authorize your LINE official account to use his/her information<br/>**unfollow**: user has blocked your LINE official account
|updated_at_min| Optional | only filter on updated_at field, which represent the latest updated time of the member(YYYY-MM-DD)
|updated_at_max| Optional | only filter on updated_at field, which represent the latest updated time of the member(YYYY-MM-DD)
|all_tag| Optional | **0**: get the tags between the updated_at duration(from the above)<br/>**1**: get all tages<br/>***default: 0***
|start| **Required**<br>(if not first page) | Value of the continuation pagetoken
>#### **Response**
Returns the status code `200` and a list of member object
| Property | Type | Description |
| :-- | :-- | :-- |
|results| Array | Array of member objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
>#### **Example response**
```json
{
"results": [
{
"line_uid": "U353dc4b8ea88acaa8663c6cd9a4f4000",
"email": "alan@example.com",
"mobile": "+886987654321",
"customer_id": "1235734897",
"gender": "male",
"tags": [
"tag1"
],
"line_display_name": "Alan Mathison Turing",
"status": "follow",
"updated_at": "2020-01-13T18:48:23.604283+08:00",
"created_at": "2020-01-13T18:48:23.604283+08:00"
},
{...}
],
"next": "OwNdFUXTfIyunwhn55vJh4fE0wu13wSPRTCUiaqhN1Nu0vLXHpzatVFtb9ZYKBxwGKoy3jOfvxSzEfOOZnFz5Y%2BKcvexmL39l5xQqQSwtiA%3D"
}
```
## **Get member behavior** <span style="color: green">(Online)
Get member behavior data of specific date
:::info
Please contact us to get the behaviors before 2020/05/26
:::
>#### **HTTP request**
`GET /openapi/v1/behavior/download/<date>/<report-type>/`
- date: iso format date
- report-type
- pageview
- product
- transaction
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
CSV File
`time`: iso format datetime with timezone
>#### **Example response**
#### pageview
| line_uid | campaign_reference<br>(develop in progress) | utm_campaign | utm_source | utm_medium | utm_content | time | page_path | page_title | page_views | views_per_session | entrances | avg_time_on_page | exits |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Uxxxxx | [{"type": "Broadcast", "name": "123", "time": "2020-05-21"}, {"type": "DPM", "name": "dpm1", "time": "2020-05-20"}] | campaign1 | source1 | medium1 | (not set) | 2020-05-25T14:00:00+00:00 | /product/1234 | 漸強實驗室 - C方案 | 1 | 0 | 0 | 133 | 0 |
#### product
| line_uid | campaign_reference<br>(develop in progress) | utm_campaign | utm_source | utm_medium | utm_content | time | product_name | adds_to_cart | removes_from_cart | item_revenue | item_quantity | checkouts | list_clicks | list_views |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Uxxxxx | [{"type": "Broadcast", "name": "123", "time": "2020-05-21"}, {"type": "DPM", "name": "dpm1", "time": "2020-05-20"}] | campaign1 | source1 | medium1 | (not set) | 2020-05-25T10:00:00+00:00 | C方案 | 3 | 1 | 0 | 0 | 0 | 0 | 0 |
#### transaction
| line_uid | campaign_reference<br>(develop in progress) | utm_campaign | utm_source | utm_medium | utm_content | time | transactions | revenue |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |---
| Uxxxxx | [{"type": "Broadcast", "name": "123", "time": "2020-05-21"}, {"type": "DPM", "name": "dpm1", "time": "2020-05-20"}] | campaign1 | source1 | medium1 | (not set) | 2020-05-25T08:00:00+00:00 | 1 | 45500 |
## **Import member with tag** <span style="color: green">(Online)</span>
Import a group of user with tags onto MAAC platform by LINE uid or customer ID.
>#### **HTTP request**
`POST /openapi/v1/member/import/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Body**
| Property | Type | Description |
| -- | -- | -- |
|import_key| String | - line_uid<br> - customer_id<br>- email<br>- mobile
|data| Array | Array of member profiles
|tags| Array | Array of tags which will be created for members in `data`
* Maximum 10000 members in one request
* Maximum 10 MB request body size
> #### **Member profile**
| Property | Required | Type | Description |
|--|--|--|--|
|line_uid| Optional | String | LINE user id of member
|customer_id| Optional | String | The id bound on the member in MAAC
|email| Optional | String | Email of member
|mobile| Optional | String | Mobile of member
|line_display_name|Optional | String |Name of the LINE member|
|gender|Optional | String ||
|tags|Optional | Array |List of tag names|
|birthday|Optional | String ||
```json
{
"import_key": "line_uid",
"data": [
{
"line_uid": "U21d78de43c3ce40fbcbc5c4ce6dfe0b0",
"line_display_name": "test_member1",
"email": "alan@example.com",
"mobile": "+886987654321",
"customer_id": "1235734897",
"gender": "male",
# personal tags
"tags": [
"tag1",
"tag2"
]
},
{
"line_uid": "U21d78de43c3ce40fbcbc5c4ce6dfe0b1",
"line_display_name": "test_member1",
"email": "alan@example.com",
"mobile": "+886987654321",
"customer_id": "1235734897",
"gender": "male",
# personal tags
"tags": [
"tag1",
"tag3"
]
},
...
],
"tags":["20200101import"] # global tags
}
```
>#### **Response**
Returns the status code `200`
| Property | Type | Description |
| :-- | :-- | :-- |
|task_id| Number | id of this importing task
|result| String |
### response
- real time sending result
```json
{
"id": 999,
"result": "start importing"
}
```
## **Import member Status** <span style="color: green">(Online)</span>
Importing member task status
>#### **HTTP request**
`GET /openapi/v1/member/import/<task-id>/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
Returns the status code `200`
| Property | Type | Description |
| :-- | :-- | :-- |
| category | String | task category: "import_member" |
| result | JSON | Once the status is 'done', this field will be returned |
| result.tags | Array |List of tag names |
|result.success| bool | the importing task is successful or not |
|result.total_num| Number | number of total imported members
|result.created_num| Number | number of new member
|result.updated_num| Number | number of existing member
|result.mismatch_num| Number | number of failed member
|result.mismatch_export_link| String | the file about the failed member
|result.start_time| String | the start time of the importing task
|result.end_time| String | the end time of the importing task
| status | String | task status |
| created_at | String | the created time of the task |
| updated_at | String | the last updated time of the task |
### response
```json
{
"category": "import_member",
"result": {
"tags": [
"test123"
],
"success": true,
"total_num": 2,
"created_num": 0,
"updated_num": 1,
"mismatch_num": 1,
"mismatch_export_link": "https://storage.googleapis.com/..."
"start_time": "2020-04-16T11:14:38.177570+08:00",
"end_time": "2020-04-16T11:14:38.868617+08:00",
},
"status": "done",
"created_at": "2020-04-16T11:14:37.505141+08:00",
"updated_at": "2020-04-16T11:14:38.930752+08:00"
}
```
# **Tags**
## **Create tag** <span style="color: green">(Online)</span>
Ceate a tag on MAAC platform.
>#### **HTTP request**
`POST /openapi/v1/tag/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Request body**
| Parameter | Type | Required | Description |
| :-- | :-- | :-- | :-- |
|name| String | **Required** |
|available_days| Number | Optional | Empty means tag will not expire. The available days starts from the tag on line member, and it will remove tag on line member when expired.
>#### **Response**
Returns the status code `201`, segment id and filters
| Property | Type | Description |
| :-- | :-- | :-- |
|tag_id| Number | tag's id
|name| String | tag's name
|available_days| Number | tag's availible days
## **Get tag List** <span style="color: green">(Online)</span>
Get a list of availalbe tags on MAAC platform.
>#### **HTTP request**
`GET /openapi/v1/tag/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
| Parameter | Required | Description |
| :-- | :-- | :-- |
|name| Optional | Name of tag
|start| **Required** (if not first page) | Value of the continuation pagetoken. 300 values pers page
>#### **Response**
Returns the status code `200` and a list of tag object
| Property | Type | Description |
| :-- | :-- | :-- |
|results| Array | Array of tag objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
>#### **Example response**
```json
{
"results": [
{
"id": 1,
"name": "tag 1",
"available_days": None
},
{...}
],
"next": "OwNdFUXTfIyunwhn55vJh4fE0wu13wSPRTCUiaqhN1Nu0vLXHpzatVFtb9ZYKBxwGKoy3jOfvxSzEfOOZnFz5Y%2BKcvexmL39l5xQqQSwtiA%3D"
}
```
## **Get tag** <span style="color: green">(Online)</span>
Get a tag on MAAC platform.
>#### **HTTP request**
`GET /openapi/v1/tag/<tag-id>/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
Returns the status code `200` and a list of tag object
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Number | Id of tag
|name| String | Name of tag
|available_days| Number | tag's active duration after being tagged to member
>#### **Example response**
```json
{
"id": 1,
"name": "tag 1",
"available_days": None
}
```
## **Tag on LINE member** <span style="color: green">(Online)</span>
>#### **HTTP request**
`POST /openapi/v1/taglinemember/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Request body**
| Parameter | Type | Required | Description |
| :-- | :-- | :-- | :-- |
|tag_id| Number | **Required** | tag's id
|line_uid| String | **Required** | LINE user id of member
>#### **Response**
| Property | Type | Description |
| :-- | :-- | :-- |
|tag_id| Number | tag's id
|line_uid| String | LINE user id of member
|created_at| String | created time in ISO format
|expired_at| String | expired date in ISO format
## **Remove tag of LINE member** <span style="color: green">(Online)</span>
>#### **HTTP request**
`DELETE /openapi/v1/taglinemember/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Request body**
| Parameter | Type | Required | Description |
| :-- | :-- | :-- | :-- |
|tag_id| Number | **Required** | tag's id
|line_uid| String | **Required** | LINE user id of member
>#### **Response**
HTTP status code `204`
# **Segment**
## **Create segment** <span style="color: green">(Online)</span>
Ceate segment based on filter condition (tags)
>#### **HTTP request**
`POST /openapi/v1/segment/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Request body**
| Parameter | Type | Required | Description |
| :-- | :-- | :-- | :-- |
|name| String | **Required** | Name of the Segment
|description| String | Optional | Description of the Segment
|operator| String | Optional | AND: match all tag status<br>OR: match any of tag status<br>default: AND
|tags| Array | **Required** | Array of Tag status
>#### **Request body example**
```json
{
"name": "testt",
"operator": "AND"
"tags": [
{
"status": "with",
"tag_id": 1
},
{
"status": "without",
"tag_id": 2
}
]
}
```
>#### **Response**
Returns the status code `201`, segment id and filters
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Integer | Id of the segment
|name| String | Name of the segment
|description| String | description of the segment
|member_count| Number | number of members in the segment<br>PS: during computatio the value will be `-1`
## **Get segment list** <span style="color: green">(Online)</span>
Ceate segment based on filter condition (tags)
>#### **HTTP request**
`GET /openapi/v1/segment/`
>#### **Request headers**
| Request header | Description |
| -- | -- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
| Parameter | Required | Description |
| -- | -- |-- |
|start| **Required** (if not first page) | Value of the continuation pagetoken
>#### **Response**
Returns the status code `200` and a list of segment object
| Property | Type | Description |
| -- | -- | -- |
|results| Array | Array of segment objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
## **Get segment** <span style="color: green">(Online)</span>
Ceate segment based on filter condition (tags)
>#### **HTTP request**
`GET /openapi/v1/segment/<segment-id>/`
>#### **Request headers**
| Request header | Description |
| -- | -- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
Returns the status code `200` and a segment object
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Integer | Id of the segment
|name| String | Name of the segment
|description| String | description of the segment
|member_count| Number | number of members in the segment<br>PS: during computation the value will be `-1`
>#### **Example response**
```json
{
"id": 123
"name": "segment 1",
"description": "The very first segment",
"member_count": 1
}
```
# **Event** <span style="color: green">(Online)</span>
## **Create event**
Create event for direct_message
>#### **HTTP request**
`POST /openapi/v1/event/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Request body**
| Parameter | Type | Required | Description |
| :-- | :-- | :-- | :-- |
|name| String | **Required** | Name of the Event
>#### **Request body example**
```json
{
"name": "到貨通知"
}
```
>#### **Response**
Returns the status code `201`, event id and name
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Integer | Id of the event
|name| String | Name of the event
## **Get event list**
>#### **HTTP request**
`GET /openapi/v1/event/`
>#### **Request headers**
| Request header | Description |
| -- | -- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
| Parameter | Required | Description |
| -- | -- |-- |
|start| **Required** (if not first page) | Value of the continuation pagetoken
|name| Optional | **support partial lookup**
>#### **Response**
Returns the status code `200` and a list of event object
| Property | Type | Description |
| -- | -- | -- |
|results| Array | Array of event objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
>#### **Request body example**
`GET /openapi/v1/event/`
>#### **Example response**
```json
{
"next": null,
"results": [
{
"id": 12,
"archived": false,
"name": "到貨通知",
"created_at": "2020-05-27T17:48:56.042752+08:00"
},
{
"id": 2,
"archived": true,
"name": "456",
"created_at": "2020-05-27T08:00:00+08:00"
},
{
"id": 1,
"archived": false,
"name": "123",
"created_at": "2020-05-27T08:00:00+08:00"
}
]
}
```
>#### **Request body example(with query param)**
`GET /openapi/v1/event/?name=到貨`
>#### **Example response**
```json
{
"next": null,
"results": [
{
"id": 12,
"archived": false,
"name": "到貨通知",
"created_at": "2020-05-27T17:48:56.042752+08:00"
},
]
}
```
## **Get event**
>#### **HTTP request**
`GET /openapi/v1/event/<event-id>/`
>#### **Request headers**
| Request header | Description |
| -- | -- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
Returns the status code `200` and a event object
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Integer | Id of the event
|name| String | Name of the event
## **Get event report**
Made for LINE automation messages. Specify the triggered event such as, shopping cart retargeting, new subscriber, etc. to track performance of each event push.
>#### **HTTP request**
`GET /openapi/v1/event/<event-id>/report/`
>#### **Request headers**
| Request header | Description |
| -- | -- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
| Parameter | Required | Description |
| -- | -- |-- |
|start_date| Optional | YYYY-MM-DD
|end_date| Optional | YYYY-MM-DD
>#### **Response**
Returns the status code `200` and a event object
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Integer | Id of the event
|report| Json | Performance metrics of the event
>#### **Example response**
```json
{
"id": 1,
"report": {
"total": {
"clicks": 0,
"adds_to_cart": 0,
"transactions": 0,
"transaction_revenue": 0.0
},
"urls": [],
"messages": []
}
}
```
# **Message**
>#### **Get or create event before using push/multicast messages APIs**
![](https://i.imgur.com/lJlXNq7.png)
## **Direct Push** <span style="color: green">(Online)</span>
Send message to user with a MAAC Template
#### path
`post /openapi/v1/direct_message/push/`
#### body
>#### **Body**
| Property | Type | Description |
| -- | -- | -- |
|template_id | Number | Id of template, which has been created in MAAC
|data | Array | Array of line_uid and parameters object
|~~event_name~~ | ~~String~~ | ~~custom event named assigned by API user~~ (will be deprecated at 2020.6.30)
|event_id | Number | event's id (add support at 2020.06.02)
* ~~Maximum 10 line_uid in one push~~
* ~~Use Direct multicast API for 10+ group push~~
* Use Direct Multicast for group push
```json
{
"template_id": 45629,
"event_id": 346,
"data": {
"line_uid":"U1348y18439jefidsgjf924r2",
"parameter1": "hello",
"parameter2": "world"
}
}
```
>#### **Response**
Returns the status code `200`
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Number | id of direct push
|event_id| Number |
|result| String or JSON |
### response
- real time sending result
```json
{
"id": 1342,
"event": "cart retarget"
"result": "success"
}
// other result sample
// LINE timeout
"result": "timeout"
// any error occur
"result": "error"
// wrong message format
"result": {
"message": "The request body has 1 error(s)",
"details": [
{
"message": "Must be one of the following values: [text, image, video, audio, location, sticker, template, imagemap, flex]",
"property": "messages[0].type"
}
]
}
```
## **Direct Multicast** <span style="color: green">(Online)</span>
Send message to a group of people with a MAAC Template. (up to 20,000 uids at once)
#### path
`POST /openapi/v1/direct_message/multicast/`
#### body
>#### **Body**
| Property | Type | Description |
| -- | -- | -- |
|template_id | Number | Id of template, which has been created in MAAC
|data(name TBD) | Json | direct multicast infos
|~~event_name~~ | ~~String~~ | ~~custom event named assigned by API user~~ (will be deprecated at 2020.6.30)
|event_id | Number | event's id (add support at 2020.06.02)
* ~~Maximum 20000 line_uid in one multicast~~
* ~~Maximum 10 MB request body size~~
* Maximum 150 line_uid in one multicast
```json
{
"template_id": 45629,
"event_id": 346,
"data": [
{
"line_uid":"U1348y18439jefidsgjf924r2",
"parameter1": "hello",
"parameter2": "world"
},
{
"line_uid":"Uofkowekgowrpgwrkpglpwlpe",
"parameter1": "cresclab",
"parameter2": "api"
},
...
]
}
```
>#### **Response**
Returns the status code `200`
| Property | Type | Description |
| :-- | :-- | :-- |
|id| Number | id of direct multicast
|event_id| Number |
|result| String |
### response
- real time sending result
```json
{
"id": 1342,
"event": "cart retarget",
"result": "start sending"
}
```
- ~~see webhook - Direct Multicast Webhook for detail push result~~
- sending result can be retrieved by [Get-Direct-Message-Report-Online](#Get-Direct-Message-Report-Online)
## **Event push Report** <span style="color: blue">(development in progress)</span>
Made for LINE automation messages. Specify the triggered event such as, shopping cart retargeting, new subscriber, etc. to track performance of each event push.
## **Get template List <span style="color: green">(Online)</span>**
Get a list of template information created from MAAC
>#### **HTTP request**
`GET /openapi/v1/template/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
| Parameter | Required | Description |
| :-- | :-- | :-- |
|start| **Required**(if not first page) | Value of the continuation pagetoken
>#### **Response**
Returns the status code `200` and a list of member object
| Property | Type | Description |
| :-- | :-- | :-- |
|results| Array | Array of template objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
> Template
| Parameter | Type | Description |
| :-- | :-- | :-- |
| id | Number | Id of template
| name | String | Id of template
| parameters | Array | Array of parameter keys
```json
{
"results": [
{
"id": 123
"name": "best_sellers_recommendation"
"parameters": [
"store_name",
"product_name",
"product_price"
]
},
...
],
"next": "OwNdFUXTfIyunwhn55vJh4fE0wu13wSPRTCUiaqhN1Nu0vLXHpzatVFtb9ZYKBxwGKoy3jOfvxSzEfOOZnFz5Y%2BKcvexmL39l5xQqQSwtiA%3D"
}
```
# **Reports**
## **Get tracelink report** <span style="color: green">(Online)</span>
>#### **HTTP request**
`GET /openapi/v1/tracelink/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
* ++Maximum length between start_date, end_date is limited to 90 days++
* ++Default return last day's report++
| Parameter | Required | Description |
| :-- | :-- | :-- |
|start_date| Optional | Report's start date (`YYYY-MM-DD`)
|end_date| Optional | Report's end date (`YYYY-MM-DD`)
|start| **Required**(if not first page) | Value of the continuation pagetoken
>#### **Response**
Returns the status code `200` and a list of member object
| Property | Type | Description |
| :-- | :-- | :-- |
|results| Array | Array of report objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
>#### **Example response**
```json
{
"next": null,
"results": [
{
"id": 13204,
"name": "1217_訂票_Star wars天行者的崛起",
"description": null,
"shorten_url": "https://maac.io/131Mg",
"created_at": "2019-12-17T15:29:24.124117+08:00",
"tags": [
"STARWARS:天行者的崛起"
],
"report": {
"clicks": 118,
"adds_to_cart": 0,
"transactions": 0,
"transaction_revenue": 0
},
"original_url": "https://www.ezding.com.tw/movieInfo?movieid=2e82d7ca1b2b4ff1bb8637bd62bf8395&campaign_code=LINE@_starwarsskywalker",
"utm": {
"utm_campaign": "booking_starwarsskywalker",
"utm_source": "LINE@",
"utm_medium": "message"
}
}
]
}
```
## **Get deeplink report** <span style="color: green">(Online)</span>
>#### **HTTP request**
`GET /openapi/v1/deeplink/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Query parameters**
* ++Maximum length between start_date, end_date is limited to 90 days++
* ++Default return last day's report++
| Parameter | Required | Description |
| :-- | :-- | :-- |
|start_date| Optional | Report's start date (`YYYY-MM-DD`)
|end_date| Optional | Report's end date (`YYYY-MM-DD`)
|start| **Required**(if not first page) | Value of the continuation pagetoken
>#### **Response**
Returns the status code `200` and a list of member object
| Property | Type | Description |
| :-- | :-- | :-- |
|results| Array | Array of report objects
|next| String | A continuation token to get the next array of objects. Returned only when there are remaining objects that were not returned in results in the original request.
>#### **Example response**
```json
{
"next": null,
"results": [
{
"id": 7095,
"name": "孕媽咪的申請手洗精表單-LINE@",
"description": "孕媽咪的申請手洗精表單-LINE@",
"shorten_url": "https://maac.io/UbmK",
"created_at": "2019-10-28T18:45:02.264830+08:00",
"tag": [
"#手洗精孕媽咪"
],
"report": {
"join_original_member": 13,
"clicks": 188,
"join_new_member": 75
}
},{...}
]
}
```
## **Get Direct Message Report** <span style="color: green">(Online)</span>
>#### **HTTP request**
`GET /openapi/v1/direct_message/<direct-message-id>/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Response**
Returns the status code `200` and a list of member object
**(update) template will be remove from response body after 2020/5/1**
>#### **Example response**
```json
// multicast
{
"id": 6333,
"category": "multicast",
"status": "sent",
"template": 4,
"result": {
"sent_time": "2020-02-12T18:21:36.913217+08:00",
"to": {
"line_ids": [
"UAAAAAA",
"UBBBBBB"
]
},
"total_count": 2,
"fail_count": 2,
"fail_info": [
{
"mark": 0,
"response": "{\"message\":\"Bad request\"}",
"line_uid": "UAAAAAA"
},
{
"mark": 1,
"response": "{\"message\":\"Bad request\"}",
"line_uid": "UBBBBBB"
}
]
}
}
// push
{
"id": 97,
"category": "push",
"status": "sent",
"template": 1,
"result": {
"sent_time": "2020-03-13T16:46:09.696395+08:00",
"to": {
"line_id": "UAAAAAA"
},
"total_count": 1,
"fail_count": 1,
"fail_info": {
"line_id": "UAAAAAA",
"result": {
"message": "Bad request"
},
"status": 400
}
}
}
```
# **Member Binding**
## **Create binding status <span style="color: green">(Online)</span>**
>#### **HTTP request**
`POST /openapi/v1/binding/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Body**
| Parameter | Required | Description |
| :-- | :-- | :-- |
|line_uid| Required | LINE user id of member
|customer_id| Required | The id bound on the member in MAAC
|email| Optional | Email of member
|mobile| Optional | Mobile of member
|gender| Optional | gender of member
|tags| Optional | list of tags of member
```json
{
"line_uid": "U353dc4b8ea88acaa8663c6cd9a4f4000",
"email": "alan@example.com",
"mobile": "+886987654321",
"customer_id": "1235734897",
"gender": "male",
"tags": [
"tag1"
]
}
```
#### response
```json
{
"detail": "success",
"member": {
"email": "alan@example.com",
"mobile": "+886987654321",
"status": "follow"
}
}
```
## **Get bind link** <span style="color: green">(Online)</span>
>#### **HTTP request**
`POST /openapi/v1/binding/bindlink/`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|Authorization| Bearer `{channel access token}` |
>#### **Body**
| Parameter | Required | Description |
| :-- | :-- | :-- |
|bind_link_id| Required | bind link id which is created on MAAC ("Bindlink" page in Notification message" tab)
|customer_id| Required | The id would be bound on the member in MAAC
|email| Optional | Email of member
|mobile| Optional | Mobile of member
```json
{
"customer_id": "1235734897",
"bind_link_id": 1
}
```
#### response
```json
// is login
{
"link": "https://maac.io/XXXX",
"is_login": True,
"line_display_name": "Alan Mathison Turing"
}
// not login
{
"link": "https://maac.io/XXXX",
"is_login": False,
}
```
# **Webhook**
## **Bindlink Webhook** <span style="color: green">(Online)</span>
While a user finish the binding process, we'll send a event via this webhook.
>#### **HTTP request**
`POST https://<custom-preset-api>`
>#### **Request headers**
| Request header | Description |
| :-- | :-- |
|<custom-preset-header-key>| <custom-preset-header-value> |
>#### **Body**
| Parameter | Type | Description |
| -- | -- | -- |
|line_uid | String | LINE user id of member
|customer_id| String | The id bound on the member of maac
|email| String | Email of member
|mobile| String | Mobile of member
|status| String | **follow**: user has added your LINE official account as a friend<br/>**auth**: user authorize your LINE official account to use his/her information<br/>**unfollow**: user has blocked your LINE official account
>#### **Response**
Returns the status code `200`
# **FAQ**
If you want to know more about Open API, you can follow the link below - [Link. Click me](https://www.notion.so/cresclab/Open-API-FAQ-f9c4b6dfcaa24e41a2503528c1ba7543)