Skip to main content
POST
/
api
/
v3
/
user-event
/
room
Store watching time analytic for room
curl --request POST \
  --url https://apix.us.amity.co/api/v3/user-event/room \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "signature": "<string>",
  "nonceStr": "<string>",
  "timestamp": "2021-03-10T03:07:16.127Z",
  "rooms": [
    {
      "roomId": "<string>",
      "startTime": "2021-03-10T03:07:16.127Z",
      "endTime": "2021-03-10T03:07:16.127Z",
      "watchSeconds": 120,
      "sessionId": "<string>"
    }
  ]
}
'
{
  "ok": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

A group of user activity on startTime, endTime and watchSeconds.

signature
string
required

RSA-SHA256 signature for request validation. Generated by:

  1. Sort data object keys alphabetically for each room
  2. Create key=value pairs (use ISO 8601 format for timestamps)
  3. Join pairs with '&' within each room
  4. Join multiple rooms with ';'
  5. Create signing string: nonceStr={nonceStr}&timestamp={timestamp}&data={dataStr}==
  6. Sign with SHA256 using your RSA private key
  7. Base64 encode the signature

Example data string: endTime=2021-03-10T03:08:16.127Z&roomId=room123&sessionId=session1&startTime=2021-03-10T03:07:16.127Z&watchSeconds=60

nonceStr
string
required

unique string for each request, max length 50

timestamp
string
required

timestamp string in UTC format

Example:

"2021-03-10T03:07:16.127Z"

rooms
object[]
required

Response

event is processed successfully

ok
boolean
Example:

true