Skip to main content
Version: 26.01

Journey Engine - User Content

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/o/journey-engine/user-content

Overview​

Return the content cooldown state of a user and the content waiting in the user's queue.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

  • Required permission: Read on the journey_engine feature

Request Parameters​

  • app_id (required): App ID
  • uid (required): User ID

Examples​

GET /o/journey-engine/user-content?app_id=6991c75b024cb89cdc04efd2&uid=1

Response​

Success Response​

{
"cooldown_hours": 24,
"cooldown_total_ms": 86400000,
"cooldown_remaining_ms": 3600000,
"last_view_ts": 1700000000000,
"queue": [
{
"content_id": "67164f4a1f1bd90d6354430c",
"name": "Welcome message",
"type": "content",
"source": "content",
"priority": 1,
"category": null,
"created_ts": 1700000000000,
"expiry_ts": 1700086400000,
"journey_id": "67164f4a1f1bd90d6354430a"
}
]
}

Response Fields​

FieldTypeDescription
cooldown_hoursNumberCooldown in hours: the app's setting, otherwise the global setting, otherwise 24.
cooldown_total_msNumberCooldown in milliseconds.
cooldown_remaining_msNumberMilliseconds until the user can see content again. 0 when the cooldown is over or set to 0.
last_view_tsNumberTimestamp of the last content view of the user. 0 when there is none.
queueArrayQueued content that has not expired, highest priority first.
queue[].content_idStringContent ID.
queue[].nameStringContent name. Empty when not found.
queue[].typeStringContent type.
queue[].sourceStringcontent or survey. Empty when not found.
queue[].priorityNumberQueue priority.
queue[].categoryString or NullContent category.
queue[].created_tsNumberTimestamp when the item was queued.
queue[].expiry_tsNumberTimestamp when the item expires.
queue[].journey_idString or NullJourney that queued the item.

Error Responses​

  • HTTP 400
{
"result": "app_id and uid are required"
}
  • HTTP 500
{
"result": "Error: <message>"
}

Behavior​

  • Queue items are ordered by priority, then by newest first.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.appsApp cooldown settingReads the app's journey_engine setting.
countly.app_users{appId}Last content viewReads the user's last view time.
countly.content_queueQueueReads the user's queued content.
countly.content_blocksContent namesReads content block details.
countly.feedback_widgetsSurvey namesReads survey widgets.