Upload custom provider costs
curl --request POST \
--url https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'csv=<string>' \
--data auto_transform=falseimport requests
url = "https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv"
payload = {
"csv": "<string>",
"auto_transform": "false"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({csv: '<string>', auto_transform: 'false'})
};
fetch('https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv', 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.vantage.sh/v2/integrations/{integration_token}/costs.csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "csv=%3Cstring%3E&auto_transform=false",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.vantage.sh/v2/integrations/{integration_token}/costs.csv"
payload := strings.NewReader("csv=%3Cstring%3E&auto_transform=false")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("csv=%3Cstring%3E&auto_transform=false")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "csv=%3Cstring%3E&auto_transform=false"
response = http.request(request)
puts response.read_body{
"token": "usr_csts_upld_68f53287682faaf8",
"filename": "costs.csv20240827-15484-pfxe9o",
"amount": "1000.0",
"start_date": "2021-01-01",
"end_date": "2021-02-01",
"import_status": "processing",
"created_by_token": "usr_9ad0e852b8c67db5",
"created_at": "2024-08-27T22:44:29.220Z"
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}Integrations
Upload custom provider costs
Create UserCostsUpload via CSV for a Custom Provider Integration.
POST
/
integrations
/
{integration_token}
/
costs.csv
Upload custom provider costs
curl --request POST \
--url https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'csv=<string>' \
--data auto_transform=falseimport requests
url = "https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv"
payload = {
"csv": "<string>",
"auto_transform": "false"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({csv: '<string>', auto_transform: 'false'})
};
fetch('https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv', 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.vantage.sh/v2/integrations/{integration_token}/costs.csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "csv=%3Cstring%3E&auto_transform=false",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://api.vantage.sh/v2/integrations/{integration_token}/costs.csv"
payload := strings.NewReader("csv=%3Cstring%3E&auto_transform=false")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("csv=%3Cstring%3E&auto_transform=false")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/integrations/{integration_token}/costs.csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "csv=%3Cstring%3E&auto_transform=false"
response = http.request(request)
puts response.read_body{
"token": "usr_csts_upld_68f53287682faaf8",
"filename": "costs.csv20240827-15484-pfxe9o",
"amount": "1000.0",
"start_date": "2021-01-01",
"end_date": "2021-02-01",
"import_status": "processing",
"created_by_token": "usr_9ad0e852b8c67db5",
"created_at": "2024-08-27T22:44:29.220Z"
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/x-www-form-urlencodedmultipart/form-data
Response
UserCostsUpload model
The token of the UserCostsUpload.
Example:
"usr_csts_upld_1234"
The filename of the uploaded costs UserCostsUpload.
Example:
"usr_csts_upld_1234.parquet"
The total amount of the costs in the UserCostsUpload.
Example:
"1234.56"
The start date of the costs in the UserCostsUpload.
Example:
"2021-01-01"
The end date of the costs in the UserCostsUpload.
Example:
"2021-01-31"
Import status of the UserCostsUpload.
Example:
"processing"
The token of the Creator of the UserCostsUpload.
Example:
"usr_1234"
When the UserCostsUpload was uploaded.
Example:
"2021-01-01T00:00:00Z"
⌘I