7.3.1. Notification¶
Get the OpenAPI file for this interface: notification.yaml
7.3.1.1. Services¶
7.3.1.1.1. Subscriber¶
-
POST
/v1/subscriptions
¶ Subscribe to a topic
Subscribes a client to receive event notification.
Subscriptions are idempotent. Subscribing twice for the same topic and endpoint (protocol, address) will return the same subscription ID and the subscriber will receive only once the notifications.
Scope required:
notif.sub.write
Query Parameters: - topic (string) – The name of the topic for which notifications will be sent (Required)
- protocol (string) – The protocol used to send the notification
- address (string) – the endpoint address, where the notifications will be sent. (Required)
- policy (string) –
The delivery policy, expressing what happens when the message cannot be delivered.
If not specified, retry will be done every hour for 7 days.
The value is a set of integer separated by comma:
- countdown: the number of seconds to wait before retrying. Default: 3600.
- max: the maximum max number of retry. -1 indicates infinite retry. Default: 168
Status Codes: - 200 OK – Subscription successfully created. Waiting for confirmation message.
- 500 Internal Server Error – Unexpected error
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "uuid": "string", "topic": "string", "protocol": "http", "address": "string", "policy": "string", "active": true }
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
Callback: onEvent
-
POST
{$request.query.address}
¶ Status Codes: - 200 OK – Message received and processed.
- 500 Internal Server Error – Unexpected error
Request Headers: - message-type – the type of the message (Required)
- subscription-id – the unique ID of the subscription
- message-id – the unique ID of the message (Required)
- topic-id – the unique ID of the topic (Required)
Example request:
POST {$request.query.address} HTTP/1.1 Host: example.com Content-Type: application/json { "type": "SubscriptionConfirmation", "token": "string", "topic": "string", "message": "string", "messageId": "string", "subject": "string", "subscribeURL": "https://example.com", "timestamp": "string" }
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
GET
/v1/subscriptions
¶ Get all subscriptions
Scope required:
notif.sub.read
Status Codes: - 200 OK – Get all subscriptions
- 500 Internal Server Error – Unexpected error
Example request:
GET /v1/subscriptions HTTP/1.1 Host: example.com Authorization: Bearer cn389ncoiwuencr
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "uuid": "string", "topic": "string", "protocol": "http", "address": "string", "policy": "string", "active": true } ]
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
DELETE
/v1/subscriptions/{uuid}
¶ Unsubscribe from a topic
Unsubscribes a client from receiving notifications for a topic
Scope required:
notif.sub.write
Parameters: - uuid (string) – the unique ID returned when the subscription was done
Status Codes: - 204 No Content – Subscription successfully removed
- 404 Not Found – Subscription not found
- 500 Internal Server Error – Unexpected error
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
GET
/v1/subscriptions/confirm
¶ Confirm the subscription
Confirm a subscription
Scope required:
notif.sub.write
Query Parameters: - token (string) – the token sent to the endpoint (Required)
Status Codes: - 200 OK – Subscription successfully confirmed
- 400 Bad Request – Invalid token
- 500 Internal Server Error – Unexpected error
Example request:
GET /v1/subscriptions/confirm?token=string HTTP/1.1 Host: example.com Authorization: Bearer cn389ncoiwuencr
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
7.3.1.1.2. Publisher¶
-
POST
/v1/topics
¶ Create a topic
Create a new topic. This service is idempotent.
Scope required:
notif.topic.write
Query Parameters: - name (string) – The topic name (Required)
Status Codes: - 200 OK – Topic was created.
- 500 Internal Server Error – Unexpected error
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "uuid": "string", "name": "string" }
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
GET
/v1/topics
¶ Get all topics
Scope required:
notif.topic.read
Status Codes: - 200 OK – Get all topics
- 500 Internal Server Error – Unexpected error
Example request:
GET /v1/topics HTTP/1.1 Host: example.com Authorization: Bearer cn389ncoiwuencr
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "uuid": "string", "name": "string" } ]
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
DELETE
/v1/topics/{uuid}
¶ Delete a topic
Delete a topic
Scope required:
notif.topic.write
Parameters: - uuid (string) – the unique ID returned when the topic was created
Status Codes: - 204 No Content – Topic successfully removed
- 404 Not Found – Topic not found
- 500 Internal Server Error – Unexpected error
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
-
POST
/v1/topics/{uuid}/publish
¶ Post a notification to a topic.
Scope required:
notif.topic.publish
Parameters: - uuid (string) – the unique ID of the topic
Query Parameters: - subject (string) – the subject of the message.
Status Codes: - 200 OK – Notification published
- 500 Internal Server Error – Unexpected error
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "code": 1, "message": "string" }
7.3.1.2. Notification Message¶
This section describes the messages exchanged through notification. All messages
are encoded in json
. They are generated by the emitter (the source of the event)
and received by zero, one, or many receivers that have subscribed to the type of event.
Event Type | Message |
---|---|
liveBirth |
Example: {
"source": "systemX",
"uin": "123456789",
"uin1": "123456789",
"uin2": "234567890"
}
|
death |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
birthCancellation |
Example: {
"source": "systemX",
"uin": "123456789",
}
|
foetalDeath |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
marriage |
Example: {
"source": "systemX",
"uin1": "123456789",
"uin2": "234567890"
}
|
divorce |
Example: {
"source": "systemX",
"uin1": "123456789",
"uin2": "234567890"
}
|
annulment |
Example: {
"source": "systemX",
"uin1": "123456789",
"uin2": "234567890"
}
|
separation |
Example: {
"source": "systemX",
"uin1": "123456789",
"uin2": "234567890"
}
|
adoption |
Example: {
"source": "systemX",
"uin": "123456789",
"uin1": "234567890"
}
|
legitimation |
Example: {
"source": "systemX",
"uin": "987654321",
"uin1": "123456789",
"uin2": "234567890"
}
|
recognition |
Example: {
"source": "systemX",
"uin": "123456789",
"uin2": "234567890"
}
|
changeOfName |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
changeOfGender |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
updatePerson |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
newPerson |
Example: {
"source": "systemX",
"uin": "123456789"
}
|
duplicatePerson |
Example: {
"source": "systemX",
"uin": "123456789",
"duplicates": [
"234567890",
"345678901"
]
}
|
Note
Anonymized notification of events will be treated separately.