
Get Treatment
This document provides a guide and overview for the GetTreatment RPC, which allows you to retrieve a single treatment by its treatment ID directly via API.
API Definition
POST https://apis.auxia.io/v1/GetTreatment
Entities
TreatmentPb
message TreatmentPb {
string project_id = 1;
string treatment_id = 2;
TreatmentTypePb treatment_type = 3;
string name = 4;
string description = 5;
repeated TreatmentVersionPb treatment_versions = 6;
Status status = 7;
string last_modified_by = 8;
google.protobuf.Timestamp last_modified_timestamp = 9;
ModificationSource modification_source = 10;
string external_treatment_id = 11;
optional MutualExclusionGroupPb mutual_exclusion_group = 12;
enum Status {
STATUS_UNSPECIFIED = 0;
LIVE = 1;
DRAFT = 2;
SCHEDULED = 3;
ARCHIVED = 4;
PAUSED = 5;
}
enum ModificationSource {
MODIFICATION_SOURCE_UNSPECIFIED = 0;
AUXIA_CONSOLE = 1;
API = 2;
}
}
GetTreatment
API to fetch the details of a single treatment by ID
message GetTreatmentRequest {
// Required
string project_id = 1;
// Required
string treatment_id = 2;
}
message GetTreatmentResponse {
TreatmentPb treatment = 1;
}
Sample cURL Request
curl --location --request POST 'https://apis.auxia.io/v1/GetTreatment' \
--header 'Content-Type: application/json' \
--header 'x-api-key: API_KEY' \
--data-raw '{
"project_id": "PROJECT_ID",
"treatment_id": "TREATMENT_ID"
}'
Sample Response
treatment {
project_id: "PROJECT_ID"
treatment_id: "TREATMENT_ID"
treatment_type {
project_id: "PROJECT_ID"
name: "TREATMENT_TYPE"
delivery_type: EMAIL
language_specific_content_field_types {
field_name: "title"
value_length_limit: 300
data_type: STRING
}
language_specific_content_field_types {
field_name: "body"
value_length_limit: 800
data_type: STRING
}
surfaces {
name: "SURFACE"
}
}
name: "NAME"
description: "DESCRIPTION"
treatment_versions {
status: LIVE
tags {
name: "TAG_1"
}
start_timestamp {
seconds: 1717200000
}
end_timestamp {
seconds: 1735689599
}
content {
content_by_language {
language_code {
language_code: "en"
}
content_fields {
field_name: "title"
string_value: "TITLE"
}
content_fields {
field_name: "body"
string_value: "BODY"
}
}
}
eligibility_rules {
rules {
data_field_id: DATA_FIELD_ID
condition: GREATER_THAN
rhs_value: "100"
}
}
target_action {
event_id: EVENT_ID
}
}
status: LIVE
last_modified_by: "user@example.com"
last_modified_timestamp {
seconds: 1717200000
}
modification_source: API
mutual_exclusion_group {
project_id: PROJECT_ID
mutual_exclusion_group_id: MEG_ID
name: "MUTUAL_EXCLUSION_GROUP"
}
}