Insights
Get post insights
Read lifetime metrics for one post.
GET
/
meta
/
v25.0
/
{postId}
/
insights
Get post insights
curl --request GET \
--url https://gateway.hookmyapp.com/meta/v25.0/{postId}/insightsimport requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights', 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://gateway.hookmyapp.com/meta/v25.0/{postId}/insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://gateway.hookmyapp.com/meta/v25.0/{postId}/insights"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyReads lifetime metrics for a post. No
period.
Authentication
Use thehmat_ channel token from GET /meta/channels/{id}/token or hookmyapp channels token <channel>. Do not use an hmok_ API key for this call.
Authorization: Bearer hmat_...
Path parameters
string
required
The post id,
{pageId}_{postId}.Query parameters
string
required
Comma-separated metric names, for example
post_clicks,post_reactions_by_type_total,post_activity_by_action_type.Example
curl "https://gateway.hookmyapp.com/meta/v25.0/{POST_ID}/insights?metric=post_clicks,post_reactions_by_type_total" \
-H "Authorization: Bearer hmat_..."
Successful response
{
"data": [
{ "name": "post_clicks", "period": "lifetime", "values": [ { "value": 12 } ] },
{ "name": "post_reactions_by_type_total", "period": "lifetime", "values": [ { "value": { "like": 3 } } ] }
]
}
⌘I
Get post insights
curl --request GET \
--url https://gateway.hookmyapp.com/meta/v25.0/{postId}/insightsimport requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights', 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://gateway.hookmyapp.com/meta/v25.0/{postId}/insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://gateway.hookmyapp.com/meta/v25.0/{postId}/insights"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{postId}/insights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body