Two endpoints — check which one your project usesAuxia serves the Get Treatments API from two different endpoints. Each project is provisioned against one of them, so you must use the endpoint assigned to your project — calls to the wrong endpoint will fail.To find your project’s endpoint, open the Auxia Console and go to Configurations → Experience Delivery → API Integrations.
API Definition
Use the endpoint that matches your project (see note above). All other request parameters, headers, and response fields are identical between the two.Path Parameters
| Name | Type | Description |
|---|---|---|
| api_key | String | A string API key that is issued to each project or company that uses Auxia. This can either be set in the request parameters or in the header. |
Headers
| Name | Type | Description |
|---|---|---|
| x-api-key | String | A string API key that is issued to each project or company that uses Auxia. This API key should have permission to call this API. This can either be set in the request parameters or in the header. |
Status Codes
- 200: OK The treatments will be returned successfully.
- 401: Unauthorized Please ensure you have added the correct API key, projectId, and any other parameters in the request.
Raw request body
Example curl
Response
Schema Reference
Request
| Name | Data Type | Required? | Description |
|---|---|---|---|
| projectId | string | Required | For a given customer’s project, this should always be the same. |
| userId | string | Required | This is the Unique ID for every user. |
| contextualAttributes | json | Optional | The set of additional attributes from the app’s context. Example: Current screen, recent actions, or context selections of the user. Each contextual attribute is a key-value pair. What to include:
Duplicate attributes with the same key will throw an exception. Examples:
|
| surfaces | json | Required | At least one surface should be provided in the request. Each surface contains:
Example:
|
| languageCode | string | Optional | The language code that is being requested for the content of the treatment. Format: IETF BCP 47. If this field is left unspecified, a default language (en) is used. Treatments that do not have translations for the requested language will not be returned. |
| maximumTreatmentCount | int64 | Optional | The maximum amount of treatments that should be returned for the client. If no value is set, this defaults to 1. |
Response
| Name | Data Type | Description |
|---|---|---|
| responseId | string | Unique ID generated for each call to getTreatments. This ID is global to the response compared to UserTreatment.treatmentTrackingId that is specific to each treatment in this response.
The treatment ID is required to ensure there is a sufficient feedback loop instead of this global response ID unless zero treatments were returned in the response. |
| userTreatments | json (see table below) | List of treatments that contain the information needed to render them in your UI or messaging system. |
userTreatments
| Name | Data Type | Description |
|---|---|---|
| treatmentId | string | A unique ID that identifies a specific treatment. It can also be found in the Auxia console in the “Overview” section under “Treatments”. |
| treatmentTrackingId | string | A unique ID that references not only the specific treatment, but also the specific RPC call in which the treatment was returned. |
| surface | string | The name of the surface, as defined above in the request, on which this treatment should be rendered or for which this treatment should be used. |
| rank | int64 | The rank of the treatment in the response for the given surface. Auxia ranks and sorts the treatments for each user before they are provisioned in the response. |
| treatmentType | string | A client-configured parameter used to decide how to render the content. Example: “In App Content Card” for rendering a card with title, text, and image, or “Banner” for a different UI component. |
| treatmentContent | json | The content to be displayed (in app) or included (messages). Placeholders in the content can be replaced by personalization signals. Content format is owned by Auxia Customers via the Treatment Config UI. It can be plain text, JSON, HTML, JS snippet, or any format directly usable by the client UI. Example: { “content”: ”{ title: ‘Check out your trends’, description: ‘87% of users found this feature useful’, cta_name: ‘View trends’, cta_link: ‘/actionscreen’ }” } |
| contentLanguageCode | string | Language code for the content of the treatment. Format: IETF BCP 47. |