SDK reference

Sharing

Each route's function in the SDK, its call beside the same request in cURL.
sharingResourcesByRn

GET/v1/sharing/resources/:rn

What you hold on a resource and where it comes from (you). If you may share it, also who has access (each grant with its rev, preset, limits and whether the owner organization's policy blocks it), its links, invitations to addresses with no account, and the owner organization's policy. No access, or no such resource, is 404.

Parameters and answers
curl 'https://api.cactive.com.au/v1/sharing/resources/{rn}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postSharingResourcesGrants

POST/v1/sharing/resources/:rn/grants

Shares a resource with a person (by user id or email address), group, circle, organization or key: a preset or a list of capabilities, and optionally notBefore, expiresAt, a weekly schedule, params, assistants, approval and a message. You can give no more than you hold. 201 with { kind: "grant" } (pending when the person must accept) or, for an address with no account, { kind: "invitation" }, which becomes a pending grant when they sign up. 403 external_sharing_off when the owner organization's policy refuses it, 403 capability_not_held_to_grant for more than you hold, 429 past the daily limit.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/sharing/resources/{rn}/grants' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "principal": {}
  }'
patchSharingResourcesGrantsByPrincipal

PATCH/v1/sharing/resources/:rn/grants/:principal

Changes a grant made directly: send the rev you read and the fields to change (null clears notBefore, expiresAt, schedule, params and approval; naming preset replaces the capabilities and settings). The result is held to the same rules as a new grant. 409 stale (with the grant as it is now) when someone changed it first. ?source= picks one when a principal holds several.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/sharing/resources/{rn}/grants/{principal}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rev": 1
  }'
deleteSharingResourcesGrantsByPrincipal

DELETE/v1/sharing/resources/:rn/grants/:principal

Ends a grant, or withdraws an invitation, for those who may share the resource, and for the grantee leaving. ?source= picks one when a principal holds several; ?rev= makes it conditional (409 stale). The person is told unless ?notify=false. 204.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/sharing/resources/{rn}/grants/{principal}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putSharingResourcesGrantsPause

PUT/v1/sharing/resources/:rn/grants/:principal/pause

Pauses a grant made directly: { until } (epoch seconds in the future, or forever until it is resumed), with an optional rev. Paused, it gives only what stays on outside a schedule (a car's name and status, not where it is or whether it moves; a person's location gives nothing), and the grantee gets no notice; their requests answer 403 paused. For whoever may change the grant. Audited as share.pause.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/sharing/resources/{rn}/grants/{principal}/pause' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "until": 1
  }'
deleteSharingResourcesGrantsPause

DELETE/v1/sharing/resources/:rn/grants/:principal/pause

Resumes a paused grant at once. Audited as share.resume.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/sharing/resources/{rn}/grants/{principal}/pause' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteSharingResourcesInvitationsByInvitationId

DELETE/v1/sharing/resources/:rn/invitations/:invitationId

Withdraws an invitation to an address with no account, by its id (the address never goes in a URL), for its maker, the owner and role holders. 204.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/sharing/resources/{rn}/invitations/{invitationId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postSharingResourcesLinks

POST/v1/sharing/resources/:rn/links

Makes a link to a resource: an audience (anyone, signed_in, or org for the owner organization's members), a preset or capabilities the type lets a link carry, an expiresAt within the longest the type allows, and an optional password. 201 with the link and its url, which is shown once and cannot be read again.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/sharing/resources/{rn}/links' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "audience": "anyone"
  }'
sharingResourcesCheck

GET/v1/sharing/resources/:rn/check

Whether a person (principal=user:usr_…) holds a capability on the resource and where it comes from, for those who may share it and for holders of tenant:read in the owner organization. Nothing is audited: it is a question, not a use.

Parameters and answers
curl 'https://api.cactive.com.au/v1/sharing/resources/{rn}/check?principal=example&capability=example' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meShared

GET/v1/me/shared

What is shared with you, your groups and your circles, newest first within a page (app, type, cursor, limit). Pages follow your principals one after another, so one can be short: carry on while cursor is set. The first page also turns invitations to your address into pending offers.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/shared' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meSharedPending

GET/v1/me/shared/pending

Offers waiting for you to accept (people outside your circles and organization share by offer), with what the owner can see of your use to read first (disclosure). They give nothing until accepted and lapse after 30 days.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/shared/pending' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeSharedAccept

POST/v1/me/shared/:grantKey/accept

Accepts an offer: it becomes access, ending when the sharer said. 410 offer_lapsed once its 30 days ran out. Recorded in your log and the owner's.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/shared/{grantKey}/accept' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeSharedDecline

POST/v1/me/shared/:grantKey/decline

Declines an offer; the sharer is told. 204.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/shared/{grantKey}/decline' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meSharingOut

GET/v1/me/sharing/out

What you share from your Personal space: the grants (newest first, paged by cursor) and, on the first page, your links.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/sharing/out' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meShared

GET/v1/me/shared

What is shared with you, your groups and your circles, newest first within a page (app, type, cursor, limit). Pages follow your principals one after another, so one can be short: carry on while cursor is set. The first page also turns invitations to your address into pending offers.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/shared' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meSharedPending

GET/v1/me/shared/pending

Offers waiting for you to accept (people outside your circles and organization share by offer), with what the owner can see of your use to read first (disclosure). They give nothing until accepted and lapse after 30 days.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/shared/pending' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeSharedAccept

POST/v1/me/shared/:grantKey/accept

Accepts an offer: it becomes access, ending when the sharer said. 410 offer_lapsed once its 30 days ran out. Recorded in your log and the owner's.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/shared/{grantKey}/accept' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMeSharedDecline

POST/v1/me/shared/:grantKey/decline

Declines an offer; the sharer is told. 204.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/me/shared/{grantKey}/decline' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meSharingOut

GET/v1/me/sharing/out

What you share from your Personal space: the grants (newest first, paged by cursor) and, on the first page, your links.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/sharing/out' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"