API Reference
Create ExposureCalculation
Calculates exposure from an assignment table.
POST
/
v1
/
exposureCalculations
Create ExposureCalculation
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/exposureCalculations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": [
"<string>"
],
"filters": [
{
"factTable": "<string>",
"displayName": "<string>"
}
],
"entityFilters": [
{
"dimensionTable": "<string>"
}
]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"labels": [
{}
],
"owner": "<string>"
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/exposureCalculations"
payload = {
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": ["<string>"],
"filters": [
{
"factTable": "<string>",
"displayName": "<string>"
}
],
"entityFilters": [{ "dimensionTable": "<string>" }]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"labels": [{}],
"owner": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exposureCalculationSpec: {
assignmentTable: '<string>',
exposureKey: '<string>',
groups: [{group: '<string>', variantKey: '<string>'}],
splitDimensions: ['<string>'],
filters: [{factTable: '<string>', displayName: '<string>'}],
entityFilters: [{dimensionTable: '<string>'}]
},
startTime: {},
endTime: {},
entity: '<string>',
labels: [{}],
owner: '<string>'
})
};
fetch('https://metrics.eu.confidence.dev/v1/exposureCalculations', 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://metrics.eu.confidence.dev/v1/exposureCalculations",
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([
'exposureCalculationSpec' => [
'assignmentTable' => '<string>',
'exposureKey' => '<string>',
'groups' => [
[
'group' => '<string>',
'variantKey' => '<string>'
]
],
'splitDimensions' => [
'<string>'
],
'filters' => [
[
'factTable' => '<string>',
'displayName' => '<string>'
]
],
'entityFilters' => [
[
'dimensionTable' => '<string>'
]
]
],
'startTime' => [
],
'endTime' => [
],
'entity' => '<string>',
'labels' => [
[
]
],
'owner' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://metrics.eu.confidence.dev/v1/exposureCalculations"
payload := strings.NewReader("{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://metrics.eu.confidence.dev/v1/exposureCalculations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/exposureCalculations")
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/json'
request.body = "{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"assignmentFilter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": [
"<string>"
],
"exposureFilter": {
"factTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"displayName": "<string>"
},
"filters": [
{
"factTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"displayName": "<string>"
}
],
"entityFilter": {
"dimensionTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
},
"entityFilters": [
{
"dimensionTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
}
]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"state": "STATE_UNSPECIFIED",
"sqlJob": "<string>",
"scheduleIteration": {},
"sql": "<string>",
"exposureTable": "<string>",
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"schedule": "<string>",
"retriggered": true,
"outdatedSourceDataInfo": {
"table": "<string>",
"expectedCount": 123,
"actualCount": 123,
"queryStartTime": {},
"queryEndTime": {}
},
"error": "<string>",
"labels": [
{}
],
"owner": "<string>"
}Authorizations
Query Parameters
Body
application/json
Response
200 - application/json
Returns a ExposureCalculation.
Represents the calculation of an a exposure table for a specific time window from an assignment table.
Was this page helpful?
⌘I
Create ExposureCalculation
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/exposureCalculations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": [
"<string>"
],
"filters": [
{
"factTable": "<string>",
"displayName": "<string>"
}
],
"entityFilters": [
{
"dimensionTable": "<string>"
}
]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"labels": [
{}
],
"owner": "<string>"
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/exposureCalculations"
payload = {
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": ["<string>"],
"filters": [
{
"factTable": "<string>",
"displayName": "<string>"
}
],
"entityFilters": [{ "dimensionTable": "<string>" }]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"labels": [{}],
"owner": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exposureCalculationSpec: {
assignmentTable: '<string>',
exposureKey: '<string>',
groups: [{group: '<string>', variantKey: '<string>'}],
splitDimensions: ['<string>'],
filters: [{factTable: '<string>', displayName: '<string>'}],
entityFilters: [{dimensionTable: '<string>'}]
},
startTime: {},
endTime: {},
entity: '<string>',
labels: [{}],
owner: '<string>'
})
};
fetch('https://metrics.eu.confidence.dev/v1/exposureCalculations', 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://metrics.eu.confidence.dev/v1/exposureCalculations",
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([
'exposureCalculationSpec' => [
'assignmentTable' => '<string>',
'exposureKey' => '<string>',
'groups' => [
[
'group' => '<string>',
'variantKey' => '<string>'
]
],
'splitDimensions' => [
'<string>'
],
'filters' => [
[
'factTable' => '<string>',
'displayName' => '<string>'
]
],
'entityFilters' => [
[
'dimensionTable' => '<string>'
]
]
],
'startTime' => [
],
'endTime' => [
],
'entity' => '<string>',
'labels' => [
[
]
],
'owner' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://metrics.eu.confidence.dev/v1/exposureCalculations"
payload := strings.NewReader("{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://metrics.eu.confidence.dev/v1/exposureCalculations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/exposureCalculations")
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/json'
request.body = "{\n \"exposureCalculationSpec\": {\n \"assignmentTable\": \"<string>\",\n \"exposureKey\": \"<string>\",\n \"groups\": [\n {\n \"group\": \"<string>\",\n \"variantKey\": \"<string>\"\n }\n ],\n \"splitDimensions\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"factTable\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n ],\n \"entityFilters\": [\n {\n \"dimensionTable\": \"<string>\"\n }\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"entity\": \"<string>\",\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"exposureCalculationSpec": {
"assignmentTable": "<string>",
"assignmentFilter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"exposureKey": "<string>",
"groups": [
{
"group": "<string>",
"variantKey": "<string>"
}
],
"splitDimensions": [
"<string>"
],
"exposureFilter": {
"factTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"displayName": "<string>"
},
"filters": [
{
"factTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"displayName": "<string>"
}
],
"entityFilter": {
"dimensionTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
},
"entityFilters": [
{
"dimensionTable": "<string>",
"filter": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
}
}
]
},
"startTime": {},
"endTime": {},
"entity": "<string>",
"state": "STATE_UNSPECIFIED",
"sqlJob": "<string>",
"scheduleIteration": {},
"sql": "<string>",
"exposureTable": "<string>",
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"schedule": "<string>",
"retriggered": true,
"outdatedSourceDataInfo": {
"table": "<string>",
"expectedCount": 123,
"actualCount": 123,
"queryStartTime": {},
"queryEndTime": {}
},
"error": "<string>",
"labels": [
{}
],
"owner": "<string>"
}
