Savings Analysis Consent
curl --request POST \
--url https://api.rampartcorporation.com/v2/sac \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"client_name": "Acme Corporation",
"timestamp": "2021-01-01T00:00:00Z",
"ip_address": "127.0.0.1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"autoOptIn": false
}
'import requests
url = "https://api.rampartcorporation.com/v2/sac"
payload = {
"client_name": "Acme Corporation",
"timestamp": "2021-01-01T00:00:00Z",
"ip_address": "127.0.0.1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"autoOptIn": False
}
headers = {
"x-client-id": "<x-client-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_name: 'Acme Corporation',
timestamp: '2021-01-01T00:00:00Z',
ip_address: '127.0.0.1',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
autoOptIn: false
})
};
fetch('https://api.rampartcorporation.com/v2/sac', 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.rampartcorporation.com/v2/sac",
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([
'client_name' => 'Acme Corporation',
'timestamp' => '2021-01-01T00:00:00Z',
'ip_address' => '127.0.0.1',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'autoOptIn' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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.rampartcorporation.com/v2/sac"
payload := strings.NewReader("{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.rampartcorporation.com/v2/sac")
.header("x-client-id", "<x-client-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rampartcorporation.com/v2/sac")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}SAC
Submit Spend Analysis Consent (SAC)
Authorize Rampart to access account spend data and perform a savings analysis for this account.
Savings Analysis Consent
curl --request POST \
--url https://api.rampartcorporation.com/v2/sac \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"client_name": "Acme Corporation",
"timestamp": "2021-01-01T00:00:00Z",
"ip_address": "127.0.0.1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"autoOptIn": false
}
'import requests
url = "https://api.rampartcorporation.com/v2/sac"
payload = {
"client_name": "Acme Corporation",
"timestamp": "2021-01-01T00:00:00Z",
"ip_address": "127.0.0.1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"autoOptIn": False
}
headers = {
"x-client-id": "<x-client-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_name: 'Acme Corporation',
timestamp: '2021-01-01T00:00:00Z',
ip_address: '127.0.0.1',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
autoOptIn: false
})
};
fetch('https://api.rampartcorporation.com/v2/sac', 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.rampartcorporation.com/v2/sac",
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([
'client_name' => 'Acme Corporation',
'timestamp' => '2021-01-01T00:00:00Z',
'ip_address' => '127.0.0.1',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'autoOptIn' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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.rampartcorporation.com/v2/sac"
payload := strings.NewReader("{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.rampartcorporation.com/v2/sac")
.header("x-client-id", "<x-client-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rampartcorporation.com/v2/sac")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_name\": \"Acme Corporation\",\n \"timestamp\": \"2021-01-01T00:00:00Z\",\n \"ip_address\": \"127.0.0.1\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"autoOptIn\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
Bearer authentication header of the form Bearer <API_KEY>.
Headers
Client ID for authentication
Body
application/json
The name of the client organization.
Example:
"Acme Corporation"
The timestamp of the consent.
Example:
"2021-01-01T00:00:00Z"
The IP address of the person providing consent.
Example:
"127.0.0.1"
The first name of the person providing consent.
Example:
"John"
The last name of the person providing consent.
Example:
"Doe"
The email of the person providing consent.
Example:
"john.doe@example.com"
Indicates whether Rampart is authorized to automatically opt the account into a contract if potential savings are identified.
Response
200 - application/json
Successfully updated SAC settings
Indicates whether the SAC settings were updated successfully.
Example:
true
⌘I
