取得會員分析圖表

Get client statistics

post

Retrieve time-series client statistics data with date and count information.

Default time range: Last 7 days if startTime and endTime are not provided

Time range limitations:

  • Maximum time range is limited to 1 year (365 days)

  • If the time range exceeds 1 year, the system will automatically adjust the startTime to be 365 days before the endTime

  • The endTime will remain unchanged to preserve the user's specified end date

Platform filtering:

  • If platform is not specified, returns data for all platforms

  • If platform is specified, returns data only for that platform

Supported platforms: line, facebook, instagram, liveChat, whatsapp

Response format: Arrays of objects with date and count properties

Authorizations
AuthorizationstringRequired

Bearer token for API authentication

Query parameters
botIdstringRequired

The bot ID for the API request

Body
secretstringRequired

Secret key for API authentication

Example: your_secret_key_here
platformstring · enumOptional

Platform type for filtering (optional, if not provided returns all platforms)

Example: linePossible values:
startTimestring · dateOptional

Start date for statistics range (optional, defaults to 7 days ago if not provided). Note - If the time range exceeds 365 days, startTime will be automatically adjusted to be 365 days before endTime.

Example: 2025-01-01
endTimestring · dateOptional

End date for statistics range (optional, defaults to today if not provided). This date will be preserved even if the time range exceeds 365 days.

Example: 2025-01-07
typestring · enumRequired

Statistics type

Default: followerExample: followerPossible values:
Responses
200

Client statistics data retrieved successfully

application/json
post
/openapi/clients/statistics
POST /api/openapi/clients/statistics?botId=text HTTP/1.1
Host: mantago.cc
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 117

{
  "secret": "your_secret_key_here",
  "platform": "line",
  "startTime": "2025-01-01",
  "endTime": "2025-01-07",
  "type": "follower"
}
{
  "success": true,
  "message": "Get client statistics successfully",
  "clientStatistics": {
    "lineFollowers": [
      {
        "date": "2025-01-10",
        "count": 1250
      },
      {
        "date": "2025-01-11",
        "count": 1255
      },
      {
        "date": "2025-01-12",
        "count": 1260
      }
    ],
    "fbFollowers": [
      {
        "date": "2025-01-10",
        "count": 920
      },
      {
        "date": "2025-01-11",
        "count": 925
      },
      {
        "date": "2025-01-12",
        "count": 930
      }
    ],
    "igFollowers": [
      {
        "date": "2025-01-10",
        "count": 1100
      },
      {
        "date": "2025-01-11",
        "count": 1110
      },
      {
        "date": "2025-01-12",
        "count": 1115
      }
    ],
    "liveChatFollowers": [
      {
        "date": "2025-01-10",
        "count": 180
      },
      {
        "date": "2025-01-11",
        "count": 182
      },
      {
        "date": "2025-01-12",
        "count": 185
      }
    ],
    "whatsappFollowers": [
      {
        "date": "2025-01-10",
        "count": 450
      },
      {
        "date": "2025-01-11",
        "count": 455
      },
      {
        "date": "2025-01-12",
        "count": 460
      }
    ],
    "totalFollowers": [
      {
        "date": "2025-01-10",
        "count": 3900
      },
      {
        "date": "2025-01-11",
        "count": 3927
      },
      {
        "date": "2025-01-12",
        "count": 3950
      }
    ]
  }
}

Last updated