curl --request GET \
--url https://int-api.mx.com/users/{user_guid}/insights/{insight_guid} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}', 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://int-api.mx.com/users/{user_guid}/insights/{insight_guid}",
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: Basic <encoded-value>"
],
]);
$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://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"insight": {
"active_at": "2022-01-07T12:00:00Z",
"client_guid": "CLT-abcd-1234",
"created_at": "2022-01-12T18:16:51Z",
"cta_clicked_at": "2022-01-13T18:13:51Z",
"description": "Gold's Gym charged you $36.71 more this month than normal. Did you upgrade your service?",
"guid": "BET-abcd-1234",
"has_associated_accounts": false,
"has_associated_categories": false,
"has_associated_merchants": false,
"has_associated_scheduled_payments": false,
"has_associated_transactions": true,
"has_been_displayed": true,
"is_dismissed": false,
"localization_payload": {
"is_enabled": false
},
"micro_call_to_action": "Learn more",
"micro_description": "Netflix charged you $5.00 more this month than normal.",
"micro_title": "Price increase",
"template": "SubscriptionPriceIncrease",
"title": "Price increase",
"updated_at": "2022-01-12T18:16:51Z",
"user_guid": "USR-1234-abcd",
"user_id": "<unknown>"
}
}Read insight
Use this endpoint to read the attributes of an insight according to its unique GUID.
curl --request GET \
--url https://int-api.mx.com/users/{user_guid}/insights/{insight_guid} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}', 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://int-api.mx.com/users/{user_guid}/insights/{insight_guid}",
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: Basic <encoded-value>"
],
]);
$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://int-api.mx.com/users/{user_guid}/insights/{insight_guid}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-api.mx.com/users/{user_guid}/insights/{insight_guid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"insight": {
"active_at": "2022-01-07T12:00:00Z",
"client_guid": "CLT-abcd-1234",
"created_at": "2022-01-12T18:16:51Z",
"cta_clicked_at": "2022-01-13T18:13:51Z",
"description": "Gold's Gym charged you $36.71 more this month than normal. Did you upgrade your service?",
"guid": "BET-abcd-1234",
"has_associated_accounts": false,
"has_associated_categories": false,
"has_associated_merchants": false,
"has_associated_scheduled_payments": false,
"has_associated_transactions": true,
"has_been_displayed": true,
"is_dismissed": false,
"localization_payload": {
"is_enabled": false
},
"micro_call_to_action": "Learn more",
"micro_description": "Netflix charged you $5.00 more this month than normal.",
"micro_title": "Price increase",
"template": "SubscriptionPriceIncrease",
"title": "Price increase",
"updated_at": "2022-01-12T18:16:51Z",
"user_guid": "USR-1234-abcd",
"user_id": "<unknown>"
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The unique identifier for a user, beginning with the prefix USR-.
The unique identifier for the insight. Defined by MX.
Query Parameters
Opt in to receiving additional data on insights. Pass
?includes=localization_payload to populate the
localization_payload object on each insight.
- When included, insights with a supported template return
localization_payloadwithis_enabled: trueand the template-specific fields populated. Unsupported templates returnlocalization_payloadwithis_enabled: false. - If the parameter is omitted entirely, the
localization_payloadkey is not included in the response at all (it is absent, notnull). - Currently supported templates:
BillAmountNotStandard,MonthlySubscriptionAggregateV2,SubscriptionPriceIncrease. This list may grow as more templates are enabled.
Response
OK
Hide child attributes
Hide child attributes
"2022-01-07T12:00:00Z"
"CLT-abcd-1234"
"2022-01-12T18:16:51Z"
"2022-01-13T18:13:51Z"
"Gold's Gym charged you $36.71 more this month than normal. Did you upgrade your service?"
"BET-abcd-1234"
false
false
false
false
true
true
false
Structured, per-template values used to render the insight description and micro_description. The shape depends on the insight template. Opt-in: returned only when ?includes=localization_payload is passed (otherwise the key is absent). When the insight's template is supported, is_enabled is true and the template-specific fields are populated. When the template is not yet supported, is_enabled is false.
- Option 1
- Option 2
- Option 3
- Option 4
Hide child attributes
Hide child attributes
Whether the localization payload is populated for this insight's template.
false false
"Learn more"
"Netflix charged you $5.00 more this month than normal."
"Price increase"
"SubscriptionPriceIncrease"
"Price increase"
"2022-01-12T18:16:51Z"
"USR-1234-abcd"

