get-user-message-history
curl --request GET \
--url https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history', 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.notifly.tech/projects/{projectId}/users/{userId}/message-history",
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.notifly.tech/projects/{projectId}/users/{userId}/message-history"
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.notifly.tech/projects/{projectId}/users/{userId}/message-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history")
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{
"data": {
"message_history": [
{
"id": "abc123",
"event_name": "send_success",
"channel": "push-notification",
"resource_id": "camp_001",
"sub_resource_id": "var_001",
"resource_type": "campaign",
"created_at": "2026-03-30T12:00:00.000Z",
"updated_at": "2026-03-30T12:00:00.000Z"
},
{
"id": "def456",
"event_name": "push_click",
"channel": "push-notification",
"resource_id": "camp_001",
"sub_resource_id": "var_001",
"resource_type": "campaign",
"created_at": "2026-03-30T12:05:00.000Z",
"updated_at": "2026-03-30T12:05:00.000Z"
}
],
"next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wMy0zMFQxMjowNTowMC4wMDBaIn0="
},
"error": null
}{
"data": null,
"error": "Invalid project ID"
}{
"data": null,
"error": "Unauthorized: Invalid Authorization Token"
}{
"data": null,
"error": "Internal Server Error: some-error-message"
}エクスポートと分析
ユーザーのメッセージ履歴を取得する
指定したユーザーのキャンペーンとユーザージャーニーの送受信履歴を、カーソルを使ってページ単位で取得します。
GET
/
projects
/
{projectId}
/
users
/
{userId}
/
message-history
get-user-message-history
curl --request GET \
--url https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history', 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.notifly.tech/projects/{projectId}/users/{userId}/message-history",
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.notifly.tech/projects/{projectId}/users/{userId}/message-history"
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.notifly.tech/projects/{projectId}/users/{userId}/message-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notifly.tech/projects/{projectId}/users/{userId}/message-history")
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{
"data": {
"message_history": [
{
"id": "abc123",
"event_name": "send_success",
"channel": "push-notification",
"resource_id": "camp_001",
"sub_resource_id": "var_001",
"resource_type": "campaign",
"created_at": "2026-03-30T12:00:00.000Z",
"updated_at": "2026-03-30T12:00:00.000Z"
},
{
"id": "def456",
"event_name": "push_click",
"channel": "push-notification",
"resource_id": "camp_001",
"sub_resource_id": "var_001",
"resource_type": "campaign",
"created_at": "2026-03-30T12:05:00.000Z",
"updated_at": "2026-03-30T12:05:00.000Z"
}
],
"next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wMy0zMFQxMjowNTowMC4wMDBaIn0="
},
"error": null
}{
"data": null,
"error": "Invalid project ID"
}{
"data": null,
"error": "Unauthorized: Invalid Authorization Token"
}{
"data": null,
"error": "Internal Server Error: some-error-message"
}カーソルベースのページネーションこのAPIはカーソルベースのページネーションを使用します。次のページを取得するには、レスポンスの
next_cursorの値を、次のリクエストのcursorパラメーターに渡してください。next_cursorがnullの場合は、最後のページです。主なイベント名
チャネルによっては、ほかのイベントも存在します。
| イベント名 | 説明 |
|---|---|
send_success | メッセージの送信成功 |
send_failure | メッセージの送信失敗 |
push_click | プッシュ通知のクリック |
push_delivered | プッシュ通知の到達 |
in_app_message_show | アプリ内ポップアップの表示 |
in_web_message_show | Webポップアップの表示 |
main_button_click | メインボタンのクリック |
close_button_click | 閉じるボタンのクリック |
failover_text_message_send_success | 代替SMSの送信成功 |
failover_text_message_send_failure | 代替SMSの送信失敗 |
日付フィルターの利用条件
start_dateとend_dateを使用する場合は、timezoneパラメーターも必ず渡してください。start_dateとend_dateは、常に両方を指定する必要があります。