Skip to content

POST /api/v3/digital-boards/{lcuid}/analytics/record-plays

Summary

POST digital-board/{id}/analytics/record-plays

Description

Record multiple plays and impression(s) for a digital board

Tags: analytics

Parameters

Header Parameters

Name Type Required Description Example
Authorization string ✓ Yes Bearer {AuthToken}
Content-Type string ✓ Yes application/json
Accept string ✓ Yes application/json
AppIdV3 string ✓ Yes LCUID-LAP-********-****-****-****-************

Request Body

Required: Yes

Content Type: application/json

Schema

Type: object

Required fields: plays

Properties:

  • plays (object) (required): An array of play reports containing the following fields Example: [{"creative_id":"C1-4DYY-LP-4Hco","play_datetime":"2022-02-02 12:00:00","play_duration":8}] or, with impressions.

Responses

Response: 200

Description: Sample Response

Content Type: application/json

Schema

Type: object

Properties:

  • success (boolean): true if the plays were recorded
Example Response
{
    "success": true
}

Example Implementations

Bash (cURL)

curl --request POST \
    "https://api.lucit.app/api/v3/digital-boards/LCUID-LB-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/record-plays" \
    --header "Authorization: Bearer {AuthToken}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
    --data "{
    \"plays\": [
        {
            \"creative_id\": \"C1-4DYY-LP-4Hco\",
            \"play_datetime\": \"2022-02-02 12:00:00\",
            \"play_duration\": 8,
            \"impressions\": 2.7
        }
    ]
}"

JavaScript (Fetch API)

const url = new URL(
    "https://api.lucit.app/api/v3/digital-boards/LCUID-LB-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/record-plays"
);

const headers = {
    "Authorization": "Bearer {AuthToken}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "AppIdV3": "LCUID-LAP-********-****-****-****-************",
};

let body = {
    "plays": [
        {
            "creative_id": "C1-4DYY-LP-4Hco",
            "play_datetime": "2022-02-02 12:00:00",
            "play_duration": 8,
            "impressions": 2.7
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

PHP (Guzzle)

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.lucit.app/api/v3/digital-boards/LCUID-LB-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/record-plays',
    [
        'headers' => [
            'Authorization' => 'Bearer {AuthToken}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'creative_id' => [
                        'C1-4DYY-LP-4Hco',
                    ],
                    'play_datetime' => [
                        '2022-02-02 12:00:00',
                    ],
                    'play_duration' => [
                        8,
                    ],
                    'impressions' => [
                        2.7,
                    ],
                ],
            ],
            [
                'plays' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Python (Requests)

import requests
import json

url = 'https://api.lucit.app/api/v3/digital-boards/LCUID-LB-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/record-plays'
payload = {
    "plays": [
        {
            "creative_id": "C1-4DYY-LP-4Hco",
            "play_datetime": "2022-02-02 12:00:00",
            "play_duration": 8,
            "impressions": 2.7
        }
    ]
}
headers = {
  'Authorization': 'Bearer {AuthToken}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

← Back to digital-boards index | Back to main index