Skip to content

Query reports

The Riversoft® STCP Gemini API provides four reports, all using GET with a Bearer token:

ReportEndpointContent
System events/reports/v2/systemEvents of the platform modules.
User events/reports/v2/usersEvents of user connections.
Operator activities/reports/v2/operatorsActions performed by operators, including through the API.
Transfer history/reports/v2/transfersFile transmissions and receptions.

Period and pagination

  • start and end set the period, as Unix timestamps in milliseconds.
  • limit sets the number of records per page (maximum of 1000).
  • When there are more results, next carries the URI of the next page. Repeat the call with that URI until next comes back empty.
START=$(( $(date -d '2025-12-20 00:00:00' +%s) * 1000 ))
END=$(( $(date -d '2025-12-20 23:59:59' +%s) * 1000 ))

Query transfers

curl -s -G \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'instance=STCPGEMINI' \
  --data-urlencode 'events=5' --data-urlencode 'events=7' \
  --data-urlencode 'results=0' \
  --data-urlencode "start=$START" --data-urlencode "end=$END" \
  --data-urlencode 'limit=1000' \
  "$API_BASE/reports/v2/transfers"
  • events: 5 = transmission and 7 = reception. Repeat the parameter to query both.
  • results: 0 = successful transfers only; -1 = failed transfers only. Omit it to get both.
  • Use user and filename to filter by user and by file name.

Query system and user events

curl -s -G \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  --data-urlencode 'instance=STCPGEMINI' \
  --data-urlencode "start=$START" --data-urlencode "end=$END" \
  --data-urlencode 'limit=1000' \
  "$API_BASE/reports/v2/system"

Replace /system with /users for user events. The msg and modulo filters narrow by message and by module.

Query operator activities

curl -s -G \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  --data-urlencode 'operador=stcpadmin' \
  --data-urlencode "start=$START" --data-urlencode "end=$END" \
  --data-urlencode 'limit=100' \
  "$API_BASE/reports/v2/operators"

Go through the pages

NEXT='/reports/v2/transfers?instance=STCPGEMINI&start='"$START"'&end='"$END"'&limit=1000'
while [ -n "$NEXT" ]; do
  RESP=$(curl -s -H "Authorization: Bearer $ACCESS_TOKEN" "$API_BASE$NEXT")
  echo "$RESP" | jq -c '.data[]?'
  NEXT=$(echo "$RESP" | jq -r '.next // empty')
done

When there are no records, the response is {"data": null, "next": ""}.

Full contract in Reference: Reports.