Skip to main content
GET
/
v1
/
surface
/
content
Get surface content
curl --request GET \
  --url https://content.{region}.api.aampe.com/v1/surface/content \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://content.{region}.api.aampe.com/v1/surface/content"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://content.{region}.api.aampe.com/v1/surface/content', 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://content.{region}.api.aampe.com/v1/surface/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://content.{region}.api.aampe.com/v1/surface/content"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://content.{region}.api.aampe.com/v1/surface/content")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://content.{region}.api.aampe.com/v1/surface/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "surface_id": "eb223fbc-9065-4ff0-ae2a-c47c623bff07",
    "assignment_id": "2ceb1da8-b6f7-4089-b55d-5ba743389cea",
    "n_alternates": 1,
    "control": {
      "min_gap_days": 1
    },
    "alternates": [
      {
        "alternate_assignment_id": "226b4d62-c25b-41bf-b45b-fd3d65120091"
      }
    ]
  }
]
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

X-API-Key
string
header
required

Query Parameters

contact_id
string
required

The ID of the user for which you want to retrieve content.

surface_id
string<uuid>[]
required

The UUID v4 IDs of the surfaces for which you want to retrieve content.

allow_unassigned
boolean
default:false

When true, surfaces without personalized content for this user may still return a default variant from Aampe. When false, those surfaces are skipped; the API returns 404 if no requested surface can be returned.

Response

Successful Response

surface_id
string<uuid>
required

UUID v4 id for the surface

Example:

"eb223fbc-9065-4ff0-ae2a-c47c623bff07"

assignment_id
string<uuid>
required

Identifier for this content assignment in the response.

Example:

"2ceb1da8-b6f7-4089-b55d-5ba743389cea"

n_alternates
integer
required

Total number of alternates.

Example:

1

control
SurfaceControl · object
required
alternates
SurfaceAlternate · object[]
required