curl --request POST \ --url https://int-api.mx.com/users/{user_guid}/notifications \ --header 'Accept-Version: <accept-version>' \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --data '{ "notification": { "content": "You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.", "subject": "Monthly Budget Report" }}'
import requests
url = "https://int-api.mx.com/users/{user_guid}/notifications"
payload = { "notification": {
"content": "You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.",
"subject": "Monthly Budget Report"
} }
headers = {
"Accept-Version": "<accept-version>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {
'Accept-Version': '<accept-version>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
notification: {
content: 'You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.',
subject: 'Monthly Budget Report'
}
})
};
fetch('https://int-api.mx.com/users/{user_guid}/notifications', 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}/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'notification' => [
'content' => 'You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.',
'subject' => 'Monthly Budget Report'
]
]),
CURLOPT_HTTPHEADER => [
"Accept-Version: <accept-version>",
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-api.mx.com/users/{user_guid}/notifications"
payload := strings.NewReader("{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept-Version", "<accept-version>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://int-api.mx.com/users/{user_guid}/notifications")
.header("Accept-Version", "<accept-version>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://int-api.mx.com/users/{user_guid}/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept-Version"] = '<accept-version>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}"
response = http.request(request)
puts response.read_body
All notifications created through the API will be of notification type API_NOTIFICATION, channel PUSH, and will not be associated to an entity. No other channels are supported. This will only have an effect for clients using an MX mobile application.
POST
/
users
/
{user_guid}
/
notifications
Create a notification
curl --request POST \ --url https://int-api.mx.com/users/{user_guid}/notifications \ --header 'Accept-Version: <accept-version>' \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --data '{ "notification": { "content": "You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.", "subject": "Monthly Budget Report" }}'
import requests
url = "https://int-api.mx.com/users/{user_guid}/notifications"
payload = { "notification": {
"content": "You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.",
"subject": "Monthly Budget Report"
} }
headers = {
"Accept-Version": "<accept-version>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {
'Accept-Version': '<accept-version>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
notification: {
content: 'You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.',
subject: 'Monthly Budget Report'
}
})
};
fetch('https://int-api.mx.com/users/{user_guid}/notifications', 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}/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'notification' => [
'content' => 'You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.',
'subject' => 'Monthly Budget Report'
]
]),
CURLOPT_HTTPHEADER => [
"Accept-Version: <accept-version>",
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-api.mx.com/users/{user_guid}/notifications"
payload := strings.NewReader("{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept-Version", "<accept-version>")
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://int-api.mx.com/users/{user_guid}/notifications")
.header("Accept-Version", "<accept-version>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://int-api.mx.com/users/{user_guid}/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept-Version"] = '<accept-version>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"notification\": {\n \"content\": \"You are projected to spend $1,920.07 more than you have budgeted for Fees & Charges. You have already spent $325.67 of $716.00.\",\n \"subject\": \"Monthly Budget Report\"\n }\n}"
response = http.request(request)
puts response.read_body
The unique identifier for objects that directly trigger a notification. For example, TRANSACTION_FEE_CHARGE and TRANSACTION_EXPENSE_LARGE notification types will have a transaction guid in this field.