Create a spending plan
curl --request POST \
--url https://int-data.moneydesktop.com/spending_plans \
--header 'MD-SESSION-TOKEN: <api-key>'import requests
url = "https://int-data.moneydesktop.com/spending_plans"
headers = {"MD-SESSION-TOKEN": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'MD-SESSION-TOKEN': '<api-key>'}};
fetch('https://int-data.moneydesktop.com/spending_plans', 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-data.moneydesktop.com/spending_plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"MD-SESSION-TOKEN: <api-key>"
],
]);
$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-data.moneydesktop.com/spending_plans"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("MD-SESSION-TOKEN", "<api-key>")
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-data.moneydesktop.com/spending_plans")
.header("MD-SESSION-TOKEN", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-data.moneydesktop.com/spending_plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MD-SESSION-TOKEN"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"spending_plan": {
"created_at": "2016-10-13T18:08:00.000Z",
"current_iteration_number": 1,
"guid": "SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262",
"updated_at": "2016-10-13T18:09:00+00:00",
"user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54"
}
}Spending Plans
Create a spending plan
Create a spending plan.
POST
/
spending_plans
Create a spending plan
curl --request POST \
--url https://int-data.moneydesktop.com/spending_plans \
--header 'MD-SESSION-TOKEN: <api-key>'import requests
url = "https://int-data.moneydesktop.com/spending_plans"
headers = {"MD-SESSION-TOKEN": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'MD-SESSION-TOKEN': '<api-key>'}};
fetch('https://int-data.moneydesktop.com/spending_plans', 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-data.moneydesktop.com/spending_plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"MD-SESSION-TOKEN: <api-key>"
],
]);
$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-data.moneydesktop.com/spending_plans"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("MD-SESSION-TOKEN", "<api-key>")
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-data.moneydesktop.com/spending_plans")
.header("MD-SESSION-TOKEN", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-data.moneydesktop.com/spending_plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MD-SESSION-TOKEN"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"spending_plan": {
"created_at": "2016-10-13T18:08:00.000Z",
"current_iteration_number": 1,
"guid": "SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262",
"updated_at": "2016-10-13T18:09:00+00:00",
"user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54"
}
}Authorizations
MX Session Token
- Request an API token using the read API token endpoint in the MX SSO API.
- Exchange an API token for a session token.
- A session token is obtained by sending a POST request to /sessions
- The session token will be used in each request made for the user. It should be passed in an
MD-SESSION-TOKENHTTP header as shown below. - This session token is valid for 30 minutes from the time it was created. The 30 minute expiration counter is refreshed with each call.
- If you send a request with an expired session token you'll receive an error code of
4011.
curl -i https://int-data.moneydesktop.com/accounts \
-H 'MD-SESSION-TOKEN: CWforZl1Vn2vC_v6H4rnQRT1DoWpDouJAV-_5TBmiQRAtA8rsOG_BoajTiOSsL0A3bd-bmHXlA-eQzc9ywItKg' \
-H 'Content-Type: application/vnd.mx.nexus.v1+json' \
-H 'Accept: application/vnd.mx.nexus.v1+json'
In documentation code examples, replace <API_KEY_VALUE> with the session token.
Response
200 - application/vnd.mx.nexus.v1+json
OK
Hide child attributes
Hide child attributes
The date and time at which the spending_plan was created.
Example:
"2016-10-13T18:08:00.000Z"
The current active associated spending_plan_iteration number for a given spending_plan.
Example:
1
The unique identifier for the spending_plan. Defined by MX.
Example:
"SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262"
The date and time at which the spending_plan was most recently updated.
Example:
"2016-10-13T18:09:00+00:00"
The unique identifier for the user to which the spending_plan belongs. Defined by MX.
Example:
"USR-fa7537f3-48aa-a683-a02a-b18940482f54"
⌘I

