AlmondTill/G3N API

On this page

userActivityTrail

mutation · in the family Support trail

What it does

Ask what one of your users was doing — a user, a window of at most seven days and your reason; the sealed per-call trail opens for that window alone.

THE MERCHANT’S DOOR: open ONE user’s sealed activity trail for ONE window (ISO instants, at most 7 days) with a reason (1–256 characters). the ledger-first rule: the opening is recorded — the ledger row + the permanent log event — BEFORE any row is unsealed; no record, no unseal. Answers the timeline in time order (time · app · build · screen · op · outcome · milliseconds · call id · session). OWNER-ONLY (the A19_TRAIL area). VALIDATION/INVALID on a bad window or a blank reason.

What happens

Records the opening in the trail ledger (visible to every owner) and on the permanent log, then reads that user’s sealed rows for the window; changes nothing else.

Who may call it

Capability area: Support trail — Opening a user’s sealed activity trail and the ledger of every opening.

Arguments

NameTypeRequiredNotes
userIdID ID!yesNo further notes.
fromString String!yesNo further notes.
toString String!yesNo further notes.
reasonString String!yesNo further notes.

Returns

UserActivityTrail UserActivityTrail! — The merchant door’s answer: the opening as recorded + the timeline in time order + the rows that refused to open (counted, never hidden).

Example request

mutation ExampleUserActivityTrail($userId: ID!, $from: String!, $to: String!, $reason: String!) {
  userActivityTrail(userId: $userId, from: $from, to: $to, reason: $reason) {
    unreadable
  }
}

Variables:

{
  "userId": "01900000-0000-7000-8000-11f967df0000",
  "from": "<from>",
  "to": "<to>",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "userActivityTrail": {
      "unreadable": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer