Measure one thing for a person (a strategy's target)
Changed onSTRATEGIES (0.227.0). Reads ONE number from a closed list of sources, for the caller or, with X-Salt-Act-For, for the person an agent acts for. Each source is scoped to the person's own rooms (they hold a seat; observers and held requests do not count), wallets and products; anything else is 404. Counts of rows and sums of completed payments only: Salt cannot read message text. An agent acting for the person is held to the grant each source needs and gets the usual refusal envelope (grant, ask) when it is missing. Sources (needs are required params; window sources take since/until, ISO 8601, default the last 30 days): room_members (chat_id; chat.read; current seats, detail.followers); room_messages (chat_id; chat.read; messages sent in the window); room_replies_to_agent (chat_id; chat.read; replies by others to the CALLER's own posts in the window); post_reactions (chat_id, post_id?; chat.read; reactions on the room's posts, or one post, in the window); payments_received (wallet_id or wallet_ids; money.read; completed payments into the person's wallets in the window, summed in the wallet's currency, detail.payments counts them; wallets of different currencies: 422 wallet_required); product_sales (product_id; shop.manage; completed payments for the product, invoices and subscription renewals, detail.revenue); message_requests_accepted (contact.read; message requests the person accepted in the window); reported (0.243.0; metric_key; no grant: a count the PERSON told the plan with POST /mandates/{id}/reported_counts, metric_key is the target's metric; the latest reading, value null until a first one, detail.reported_by and detail.source_label say who reported it; an agent acting for the person reads the counts reported on plans it holds for them, mandate_id narrows to one plan); post_email_subscribers (0.243.0; contact.read; people with an active email subscription to the person's posts, 422 source_unavailable where subscriptions are not available).
Request
- Base URL: https://saltapp.ai
- URL: https://saltapp.ai/api/v1/metrics
- Auth: API key in header api-key
Query parameters
reported only: the target's metric.
reported only: narrow to one plan.
Comma separated.
Response
The measurement.
Changes
- breaking
the response property
became nullable for the status - info
added the new optional
queryrequest parametermandate_id - info
added the new optional
queryrequest parametermetric_key - info
added the new enum value
post_email_subscribersto thequeryrequest parametersource - info
added the new enum value
reportedto thequeryrequest parametersource
- breaking