Get Budget Spending
curl --request GET \
--url https://api.wistx.ai/v1/budgets/{budget_id}/spendingimport requests
url = "https://api.wistx.ai/v1/budgets/{budget_id}/spending"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/budgets/{budget_id}/spending', 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.wistx.ai/v1/budgets/{budget_id}/spending",
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://api.wistx.ai/v1/budgets/{budget_id}/spending"
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://api.wistx.ai/v1/budgets/{budget_id}/spending")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/budgets/{budget_id}/spending")
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{
"budget_id": "bud_abc123",
"name": "Production Budget",
"status": "active"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}
{
"detail": "User ID not found in authentication token"
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Failed to process request"
}
}
Infrastructure Budget
Get Budget Spending
Get spending details for an infrastructure budget
GET
/
v1
/
budgets
/
{budget_id}
/
spending
Get Budget Spending
curl --request GET \
--url https://api.wistx.ai/v1/budgets/{budget_id}/spendingimport requests
url = "https://api.wistx.ai/v1/budgets/{budget_id}/spending"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/budgets/{budget_id}/spending', 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.wistx.ai/v1/budgets/{budget_id}/spending",
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://api.wistx.ai/v1/budgets/{budget_id}/spending"
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://api.wistx.ai/v1/budgets/{budget_id}/spending")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/budgets/{budget_id}/spending")
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{
"budget_id": "bud_abc123",
"name": "Production Budget",
"status": "active"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}
{
"detail": "User ID not found in authentication token"
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Failed to process request"
}
}
Get spending details for an infrastructure budget
curl --request GET \
--url https://api.wistx.ai/v1/budgets/bud_abc123/spending \
--header 'Authorization: Bearer YOUR_API_KEY'
# See create-budget.mdx for full Python example
# See create-budget.mdx for full JavaScript example
# See create-budget.mdx for full Go example
# See create-budget.mdx for full Ruby example
# See create-budget.mdx for full PHP example
# See create-budget.mdx for full Java example
Response
{
"budget_id": "bud_abc123",
"name": "Production Budget",
"status": "active"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}
{
"detail": "User ID not found in authentication token"
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Failed to process request"
}
}
Related Endpoints
- Create Budget - Create a new budget
- List Budgets - List all budgets