메인 콘텐츠로 건너뛰기
POST
/
dmp
/
v0
/
log
/
activity
Record Activity Log
curl --request POST \
  --url https://your_a2_service/dmp/v0/log/activity \
  --header 'Content-Type: application/json' \
  --data '
{
  "catalogs": [
    {
      "id": "<string>"
    }
  ],
  "channel": "<string>",
  "device_id": "<string>",
  "schema": "activity.item_view",
  "timestamp": 123,
  "user_id": "<string>",
  "device": {
    "ext": "<unknown>",
    "geo": {
      "accuracy": 123,
      "city": "<string>",
      "country": "<string>",
      "ext": "<unknown>",
      "lastfix": 1,
      "lat": 123,
      "lon": 123,
      "metro": "<string>",
      "region": "<string>",
      "regionfips104": "<string>",
      "utcoffset": 123,
      "zip": "<string>"
    },
    "ip": "<string>",
    "ua": "<string>"
  },
  "id": "<string>",
  "page_id": "<string>"
}
'
import requests

url = "https://your_a2_service/dmp/v0/log/activity"

payload = {
    "catalogs": [{ "id": "<string>" }],
    "channel": "<string>",
    "device_id": "<string>",
    "schema": "activity.item_view",
    "timestamp": 123,
    "user_id": "<string>",
    "device": {
        "ext": "<unknown>",
        "geo": {
            "accuracy": 123,
            "city": "<string>",
            "country": "<string>",
            "ext": "<unknown>",
            "lastfix": 1,
            "lat": 123,
            "lon": 123,
            "metro": "<string>",
            "region": "<string>",
            "regionfips104": "<string>",
            "utcoffset": 123,
            "zip": "<string>"
        },
        "ip": "<string>",
        "ua": "<string>"
    },
    "id": "<string>",
    "page_id": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    catalogs: [{id: '<string>'}],
    channel: '<string>',
    device_id: '<string>',
    schema: 'activity.item_view',
    timestamp: 123,
    user_id: '<string>',
    device: {
      ext: '<unknown>',
      geo: {
        accuracy: 123,
        city: '<string>',
        country: '<string>',
        ext: '<unknown>',
        lastfix: 1,
        lat: 123,
        lon: 123,
        metro: '<string>',
        region: '<string>',
        regionfips104: '<string>',
        utcoffset: 123,
        zip: '<string>'
      },
      ip: '<string>',
      ua: '<string>'
    },
    id: '<string>',
    page_id: '<string>'
  })
};

fetch('https://your_a2_service/dmp/v0/log/activity', 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://your_a2_service/dmp/v0/log/activity",
  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([
    'catalogs' => [
        [
                'id' => '<string>'
        ]
    ],
    'channel' => '<string>',
    'device_id' => '<string>',
    'schema' => 'activity.item_view',
    'timestamp' => 123,
    'user_id' => '<string>',
    'device' => [
        'ext' => '<unknown>',
        'geo' => [
                'accuracy' => 123,
                'city' => '<string>',
                'country' => '<string>',
                'ext' => '<unknown>',
                'lastfix' => 1,
                'lat' => 123,
                'lon' => 123,
                'metro' => '<string>',
                'region' => '<string>',
                'regionfips104' => '<string>',
                'utcoffset' => 123,
                'zip' => '<string>'
        ],
        'ip' => '<string>',
        'ua' => '<string>'
    ],
    'id' => '<string>',
    'page_id' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "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://your_a2_service/dmp/v0/log/activity"

	payload := strings.NewReader("{\n  \"catalogs\": [\n    {\n      \"id\": \"<string>\"\n    }\n  ],\n  \"channel\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"schema\": \"activity.item_view\",\n  \"timestamp\": 123,\n  \"user_id\": \"<string>\",\n  \"device\": {\n    \"ext\": \"<unknown>\",\n    \"geo\": {\n      \"accuracy\": 123,\n      \"city\": \"<string>\",\n      \"country\": \"<string>\",\n      \"ext\": \"<unknown>\",\n      \"lastfix\": 1,\n      \"lat\": 123,\n      \"lon\": 123,\n      \"metro\": \"<string>\",\n      \"region\": \"<string>\",\n      \"regionfips104\": \"<string>\",\n      \"utcoffset\": 123,\n      \"zip\": \"<string>\"\n    },\n    \"ip\": \"<string>\",\n    \"ua\": \"<string>\"\n  },\n  \"id\": \"<string>\",\n  \"page_id\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	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://your_a2_service/dmp/v0/log/activity")
  .header("Content-Type", "application/json")
  .body("{\n  \"catalogs\": [\n    {\n      \"id\": \"<string>\"\n    }\n  ],\n  \"channel\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"schema\": \"activity.item_view\",\n  \"timestamp\": 123,\n  \"user_id\": \"<string>\",\n  \"device\": {\n    \"ext\": \"<unknown>\",\n    \"geo\": {\n      \"accuracy\": 123,\n      \"city\": \"<string>\",\n      \"country\": \"<string>\",\n      \"ext\": \"<unknown>\",\n      \"lastfix\": 1,\n      \"lat\": 123,\n      \"lon\": 123,\n      \"metro\": \"<string>\",\n      \"region\": \"<string>\",\n      \"regionfips104\": \"<string>\",\n      \"utcoffset\": 123,\n      \"zip\": \"<string>\"\n    },\n    \"ip\": \"<string>\",\n    \"ua\": \"<string>\"\n  },\n  \"id\": \"<string>\",\n  \"page_id\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://your_a2_service/dmp/v0/log/activity")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"catalogs\": [\n    {\n      \"id\": \"<string>\"\n    }\n  ],\n  \"channel\": \"<string>\",\n  \"device_id\": \"<string>\",\n  \"schema\": \"activity.item_view\",\n  \"timestamp\": 123,\n  \"user_id\": \"<string>\",\n  \"device\": {\n    \"ext\": \"<unknown>\",\n    \"geo\": {\n      \"accuracy\": 123,\n      \"city\": \"<string>\",\n      \"country\": \"<string>\",\n      \"ext\": \"<unknown>\",\n      \"lastfix\": 1,\n      \"lat\": 123,\n      \"lon\": 123,\n      \"metro\": \"<string>\",\n      \"region\": \"<string>\",\n      \"regionfips104\": \"<string>\",\n      \"utcoffset\": 123,\n      \"zip\": \"<string>\"\n    },\n    \"ip\": \"<string>\",\n    \"ua\": \"<string>\"\n  },\n  \"id\": \"<string>\",\n  \"page_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body

본문

application/json
catalogs
object[]
필수
channel
string
필수

Channel through which the activity occurred (e.g., 'web', 'mobile', 'app')

device_id
string
필수

Unique identifier for the device used

schema
enum<string>
필수
사용 가능한 옵션:
activity.item_view
timestamp
integer<int64>
필수

Unix timestamp when the activity occurred

user_id
string
필수

Unique identifier for the user performing the activity

device
object | null

Optional AdCom v1.0 Device information

id
string | null

Optional unique identifier for the activity event

page_id
string | null

Optional identifier for the specific page where the activity occurred

응답

200

OK