Intempt
  1. Server Side Experiments
Intempt
  • Installation
    • Basic Intempt Installation
    • Create source
    • Web Snippet
    • Google Tag Manager
    • Autocapture setup
    • SPA tracking
    • Environment Setup
    • Validating Installation
  • SDK
    • JS SDK
    • Android SDK
    • iOS SDK
    • Node.js SDK
  • API Reference
    • Track data
      POST
    • Consent
      POST
    • Choose API
      POST
    • Recommendations Feed API
      POST
  • Data Ingestion & Tracking
    • identify()
    • track()
    • record()
    • alias()
    • group()
    • consent()
    • intempt:html / intempt:page / intempt:session
    • Product Catalog Ingestion via API
  • Data Models & Event Schema
    • Event Schema Overview
    • Required Fields
    • Attribute Schema
    • Product Catalog Schema
  • Webhooks
    • Webhook Configuration
  • Server Side Experiments
    • Overview
    • Choose API endpoint
    • Handling Experiment Response
  1. Server Side Experiments

Choose API endpoint

Choose API — Endpoint & Request Structure#

Endpoint#

POST https://api.intempt.com/v1/{orgName}/projects/{projectName}/optimization/choose-api?apiKey=YOUR_API_KEY

Path Parameters#

orgName — Your Intempt organization name
projectName — The project where the experiment is configured
apiKey — Your API key (passed as a query parameter)

Request Body Structure#

The request body defines how the user is identified and which experiment(s) or group(s) you want to resolve.

Identification Methods#

1. Using sourceId + profileId#

"identification": {
  "sourceId": "1575686747310551XXX",
  "profileId": "profile_c2daf740e3e9f7aa48c6f6563f192XXX"
}

2. Using userId#

(Works only if this userId already exists in Intempt)
"identification": {
  "userId": "user_123456"
}

Optional Session & Device Fields#

Including these fields improves accuracy and reporting:

sessionId#

A unique ID that groups multiple requests within the same browsing session.
"sessionId": "my_session_1"

device#

Defines the device where the experiment is running.
Possible values: "mobile", "desktop"
"device": "mobile"
These fields can also be used as limitations when configuring experiences in Intempt.

Resolving by Experiment Names#

{
  "identification": {
    "sourceId": "1575686747310551XXX",
    "profileId": "profile_c2daf740e3e9f7aa48c6f6563f192XXX"
  },
  "names": [
    "demo-server-side-experiment",
    "demo-server-side-personalization-most-popular"
  ],
  "device": "mobile",
  "sessionId": "my_session_XXX"
}

Resolving by Groups#

{
  "identification": {
    "sourceId": "1575686747310551XXX",
    "profileId": "profile_c2daf740e3e9f7aa48c6f6563f192XXX"
  },
  "groups": ["my-group"],
  "device": "mobile",
  "sessionId": "my_session_XXX"
}

Example Response#

{
  "choices": [
    {
      "name": "demo-server-side-personalization-most-popular",
      "group": "my-group",
      "body": {
        "label": "My most popular products PERSONALIZATION",
        "products": [
          {
            "price": "250.0",
            "title": "PMC Bronze 9mm (FMJ) 124 GR. 1000 Rds. (SKU: 9G)",
            "category": "Ammunition"
          }
        ]
      }
    }
  ]
}
Modified at 2025-12-03 13:41:10
Previous
Overview
Next
Handling Experiment Response
Built with