Subscriptions
Get Subscription Status
Returns information about a subscription via id/key sent as part of a link in an e-mail message.
This API ignores the signed in user, that is, the subscription identified by the key is returned regardless of the signed in user (could be for other user than the one currently signed in). The page handling the link should typically not display the name of signed in user to avoid confusion. A user does not need to be signed in to use this API.
The e-mail typically links to the address /notifications/subscriptions/{id}
relative to the base address
of the app. The relative adress
should not typically be changed and is defined in message blocks which in turn is used by the message templates of the system. See Momentum Fastighet, menu System / Meddelandetjänst / Meddelandeblock, open the message block EpostExternAktorPostfixNotifiering
. The base address
of the app is configured on menu Inställningar / System / Systemåtkomstpunkt, click the row for Extern åtkomst
.
Request
Example
A link, e g https://mypages.domain.com/notifications/subscriptions/RvHx0zDTnRIHAZk3c35QoMKteNt2223e, is sent to the user in an e-mail message. The user clicks the link, the client app extracts the id from the URL and then calls the status api below to retrieve status of the subscription:
Parameters
(none)
Response
Example
{
"subscribed": true,
"notificationTypes": [
{
"displayName": "Uthyrning Intresse: Bekräftelse intresseanmälan",
"subscribed": true
}
]
}
Name | Description |
---|---|
subscribed | If true then the user (receiver of the link) is subscribed to one or more of the listed notificationTypes and will receive notifications for them. |
notificationTypes | List of underlying notification types included by the subscription. |
.notificationTypes
Name | Description |
---|---|
displayName | Display name of the notification type |
subscribed | If true then the user (receiver of the link) is subscribed and will receive notifications. |
Update Subscription Status
Update information for a specific subscription. Currently this API can only be used to set if the user is subscribed or not (unsubscribe).
This API ignores the signed in user, that is, the subscription identified by the key is returned regardless of the signed in user (could be for other user than the one currently signed in). The page handling the link should typically not display the name of signed in user to avoid confusion. A user does not need to be signed in to use this API.
Request
Example
To unsubscribe, send:
To undo and subscribe again, send:
Parameters
Name | Description |
---|---|
subscribed | Use true if the user should be subscribed, false to unsubscribe. |
Response
(none)