Skip to main content

Subscription

ResourceFoundation · OtherTrial useMaturity 3

The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action.

Tested supportFull test results →
Backends
PostgreSQLElasticsearch
Interactions
CreateReadUpdatePatchDelete
Search
6 of 6 parameters tested

Structure​

ElementCard.TypeDescription
statusRequired?!Σ
1..1coderequested | active | error | offBinding (required): subscription-status
contactΣ
0..*ContactPointContact details for source (e.g. troubleshooting)
endΣ
0..1instantWhen to automatically delete the subscription
reasonRequiredΣ
1..1stringDescription of why this subscription was created
criteriaRequiredΣ
1..1stringRule for server push
errorΣ
0..1stringLatest error note
channelRequiredΣ
1..1BackboneElementThe channel on which to report matches to the criteria
typeRequiredΣ
1..1coderest-hook | websocket | email | sms | messageBinding (required): subscription-channel-type
endpointΣ
0..1urlWhere the channel points to
payloadΣ
0..1codeMIME type to send, or omit for no payloadBinding (required): mimetypes
headerΣ
0..*stringUsage depends on the channel type

Σ in _summary results · ?! modifier element · 1.. required · inherited elements in grey

Search parameters​

Query with GET [base]/Subscription?[parameter]=[value]. Type decides which modifiers and prefixes apply, see search features.

ParameterTypeDescriptionPGES
contacttoken

Contact details for the subscription

Subscription.contact
criteriastring

The search rules used to determine when to send a notification

Subscription.criteria
payloadtoken

The mime-type of the notification payload

Subscription.channel.payload
statustoken

The current state of the subscription

Subscription.status
typetoken

The type of channel for the sent notifications

Subscription.channel.type
urluri

The uri that will receive the notifications

Subscription.channel.endpoint

PG: PostgreSQL, ES: Elasticsearch. passes its TestScript checks, fails, not tested yet.

Common parameters on every resource (8)
_haste-health-authorreference

The author of the resource

_idtoken

Logical id of this artifact

_lastUpdateddate

When the resource version last changed

_profileuri

Profiles this resource claims to conform to

_securitytoken

Security Labels applied to this resource

_sourceuri

Identifies where the resource comes from

_tagtoken

Tags applied to this resource

_typetoken

Derived from the R4B Definition