Get pricing analytics
curl --request GET \
--url https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"connectionId": "<string>",
"dataPoints": [
{
"cost": 123,
"country": "<string>",
"end": "2023-11-07T05:31:56Z",
"phoneNumber": "<string>",
"pricingCategory": "<string>",
"pricingType": "<string>",
"start": "2023-11-07T05:31:56Z",
"tier": "<string>",
"volume": 123
}
],
"end": "2023-11-07T05:31:56Z",
"granularity": "HALF_HOUR",
"phoneNumber": "<string>",
"start": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}AIsa Messaging
Get pricing analytics
WhatsApp. Message volume and approximate cost for one connected WhatsApp number. Read live from Meta’s pricing_analytics on the WhatsApp Business Account and scoped to that account’s phone number.
Meta’s figures are approximate and can lag; Meta bills from its own invoice.
Meta limits how far back and how fine the data goes (for example HALF_HOUR only over short ranges), and answers out-of-range requests with an error.
GET
https://api.aisa.one
/
apis
/
v1
/
social
/
messaging
/
whatsapp
/
pricing-analytics
Get pricing analytics
curl --request GET \
--url https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"connectionId": "<string>",
"dataPoints": [
{
"cost": 123,
"country": "<string>",
"end": "2023-11-07T05:31:56Z",
"phoneNumber": "<string>",
"pricingCategory": "<string>",
"pricingType": "<string>",
"start": "2023-11-07T05:31:56Z",
"tier": "<string>",
"volume": 123
}
],
"end": "2023-11-07T05:31:56Z",
"granularity": "HALF_HOUR",
"phoneNumber": "<string>",
"start": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/social/messaging/whatsapp/pricing-analytics
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/social/messaging/whatsapp/pricing-analytics - connectionId: query; required
- start: query; required
- end: query; required
- granularity: query; required
- dimensions: query; optional
- metricTypes: query; optional
- pricingTypes: query; optional
- pricingCategories: query; optional
- countryCodes: query; optional
{
"operationId": "get_aisa_messaging_apis_v1_social_messaging_whats_a49313",
"method": "GET",
"path": "/apis/v1/social/messaging/whatsapp/pricing-analytics",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Range start, ISO 8601 date or date-time.",
"in": "query",
"name": "start",
"required": true,
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"description": "Range end, ISO 8601 date or date-time. Must be after start.",
"in": "query",
"name": "end",
"required": true,
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"description": "Size of each data point. Use DAILY for short or month-to-date ranges.\n\nMeta refuses MONTHLY when the range is too short for a monthly bucket (for example a range that starts at the beginning of the current month and ends today). That is a 400 with `param: granularity` and Meta's reason in `error`.",
"in": "query",
"name": "granularity",
"required": true,
"schema": {
"enum": [
"HALF_HOUR",
"DAILY",
"MONTHLY"
],
"type": "string"
}
},
{
"description": "Comma-separated breakdowns: COUNTRY, PHONE, PRICING_CATEGORY, PRICING_TYPE, TIER. Without it each data point is a total for the interval.",
"in": "query",
"name": "dimensions",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated: COST, VOLUME. Defaults to both.",
"in": "query",
"name": "metricTypes",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated filter: REGULAR, FREE_CUSTOMER_SERVICE, FREE_ENTRY_POINT.",
"in": "query",
"name": "pricingTypes",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated filter of Meta pricing categories, for example MARKETING, MARKETING_LITE, UTILITY, AUTHENTICATION, AUTHENTICATION_INTERNATIONAL, SERVICE, REFERRAL_CONVERSION.",
"in": "query",
"name": "pricingCategories",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Comma-separated ISO 3166-1 alpha-2 country codes to filter on.",
"in": "query",
"name": "countryCodes",
"required": false,
"schema": {
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation.Authorizations
Query Parameters
Size of each data point. Use DAILY for short or month-to-date ranges.
Meta refuses MONTHLY when the range is too short for a monthly bucket (for example a range that starts at the beginning of the current month and ends today). That is a 400 with param: granularity and Meta's reason in error.
Available options:
HALF_HOUR, DAILY, MONTHLY Response
Success