notifications
Version 0.1.08 opérations
Which push providers are configured, and the Web Push public key
GET/me/push/configClé API
Paramètres
Aucun paramètre.
Réponses
200
webPushWebPushConfigDtoobligatoireenabledbooleanobligatoirepublicKeystring | nullobligatoireVAPID public key (base64url) for PushManager.subscribe
fcmProviderStateDtoobligatoireenabledbooleanobligatoire
Exemples de code
curl -X GET "$KONNECT_API_URL/me/push/config" \
-H "Authorization: Bearer $KONNECT_API_KEY"Exemple : 200
{
"webPush": {
"enabled": true,
"publicKey": "publicKey"
},
"fcm": {
"enabled": true
}
}Active devices of the signed-in user
GET/me/push/devicesClé API
Paramètres
endpointstringqueryEndpoint or token of this browser or app, to mark it
current
Réponses
200
idstring (uuid)obligatoireplatformstringobligatoire- enum: "web", "android", "ios"
labelstringobligatoirelocalestringobligatoire- enum: "fr", "en"
organisationIdstring (uuid) | nullobligatoirecreatedAtstringobligatoirelastSeenAtstringobligatoirecurrentbooleanobligatoireThe device of the registration or of the
endpointquery
Exemples de code
curl -X GET "$KONNECT_API_URL/me/push/devices" \
-H "Authorization: Bearer $KONNECT_API_KEY"Exemple : 200
[
{
"id": "id",
"platform": "web",
"label": "Chrome, macOS",
"locale": "fr",
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"createdAt": "createdAt",
"lastSeenAt": "lastSeenAt",
"current": true
}
]Register or refresh this browser or app
POST/me/push/devicesClé API
A web device sends its PushSubscription, an app its FCM token. Registering a token again refreshes it; a token registered by another user moves to this one.
Paramètres
Aucun paramètre.
Corps de la requête application/json
platformstringobligatoire- enum: "web", "android", "ios"
tokenstringFCM registration token (android, ios)
subscriptionanyWeb Push subscription (web)
organisationIdstring (uuid)Only this organisation; every organisation of the user when absent
localestring- enum: "fr", "en"
- default: "fr"
Réponses
201
idstring (uuid)obligatoireplatformstringobligatoire- enum: "web", "android", "ios"
labelstringobligatoirelocalestringobligatoire- enum: "fr", "en"
organisationIdstring (uuid) | nullobligatoirecreatedAtstringobligatoirelastSeenAtstringobligatoirecurrentbooleanobligatoireThe device of the registration or of the
endpointquery
400validation_failed, push_provider_disabled, push_subscription_required, push_token_required
404organisation_not_found
Exemples de code
curl -X POST "$KONNECT_API_URL/me/push/devices" \
-H "Authorization: Bearer $KONNECT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform": "web",
"token": "token",
"subscription": {
"endpoint": "endpoint",
"keys": {
"p256dh": "p256dh",
"auth": "auth"
}
},
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"locale": "fr"
}'Exemple : corps de la requête
{
"platform": "web",
"token": "token",
"subscription": {
"endpoint": "endpoint",
"keys": {
"p256dh": "p256dh",
"auth": "auth"
}
},
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"locale": "fr"
}Exemple : 201
{
"id": "id",
"platform": "web",
"label": "Chrome, macOS",
"locale": "fr",
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"createdAt": "createdAt",
"lastSeenAt": "lastSeenAt",
"current": true
}Stop notifications on a device
DELETE/me/push/devices/{deviceId}Clé API
Paramètres
deviceIdstringpathobligatoire
Réponses
204
404push_device_not_found
Exemples de code
curl -X DELETE "$KONNECT_API_URL/me/push/devices/deviceId" \
-H "Authorization: Bearer $KONNECT_API_KEY"Send a test notification to one device or to every active device
POST/me/push/testClé API
Paramètres
Aucun paramètre.
Corps de la requête application/json
deviceIdstring (uuid)One device; every active device when absent
Réponses
200
itemsPushDeliveryDto[]obligatoireidstring (uuid)obligatoiredeviceIdstring (uuid)obligatoiredeviceLabelstringobligatoiretypestringobligatoire- enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
organisationIdstring (uuid) | nullobligatoirestatusstringobligatoire- enum: "pending", "sent", "retrying", "failed", "invalid_token", "skipped"
skipReasonstring | nullobligatoire- enum: "allowlist", "rate_limited", "quiet_hours", "provider_disabled", "imported_account_protected"
responseClassstring | nullobligatoire- enum: "delivered", "invalid_token", "rate_limited", "payload_rejected", "auth_error", "server_error", "network_error"
titlestringobligatoirebodystringobligatoireurlstringobligatoireRelative deep link of the dashboard
createdAtstringobligatoiresentAtstring | nullobligatoire
404push_device_not_found
Exemples de code
curl -X POST "$KONNECT_API_URL/me/push/test" \
-H "Authorization: Bearer $KONNECT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"deviceId": "deviceId"
}'Exemple : corps de la requête
{
"deviceId": "deviceId"
}Exemple : 200
{
"items": [
{
"id": "id",
"deviceId": "deviceId",
"deviceLabel": "deviceLabel",
"type": "payment_received",
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"status": "pending",
"skipReason": "allowlist",
"responseClass": "delivered",
"title": "title",
"body": "body",
"url": "url",
"createdAt": "createdAt",
"sentAt": "sentAt"
}
]
}Last notifications of the signed-in user, newest first
GET/me/push/deliveriesClé API
Paramètres
cursoranyquerylimitintegerquery- max: 100
- default: 20
Réponses
200
itemsPushDeliveryDto[]obligatoireidstring (uuid)obligatoiredeviceIdstring (uuid)obligatoiredeviceLabelstringobligatoiretypestringobligatoire- enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
organisationIdstring (uuid) | nullobligatoirestatusstringobligatoire- enum: "pending", "sent", "retrying", "failed", "invalid_token", "skipped"
skipReasonstring | nullobligatoire- enum: "allowlist", "rate_limited", "quiet_hours", "provider_disabled", "imported_account_protected"
responseClassstring | nullobligatoire- enum: "delivered", "invalid_token", "rate_limited", "payload_rejected", "auth_error", "server_error", "network_error"
titlestringobligatoirebodystringobligatoireurlstringobligatoireRelative deep link of the dashboard
createdAtstringobligatoiresentAtstring | nullobligatoire
nextCursorstring | nullobligatoire
Exemples de code
curl -X GET "$KONNECT_API_URL/me/push/deliveries" \
-H "Authorization: Bearer $KONNECT_API_KEY"Exemple : 200
{
"items": [
{
"id": "id",
"deviceId": "deviceId",
"deviceLabel": "deviceLabel",
"type": "payment_received",
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"status": "pending",
"skipReason": "allowlist",
"responseClass": "delivered",
"title": "title",
"body": "body",
"url": "url",
"createdAt": "createdAt",
"sentAt": "sentAt"
}
],
"nextCursor": "nextCursor"
}Notification preferences of the signed-in member
GET/organisations/{id}/push/preferencesClé API
Paramètres
idstringpathobligatoire
Réponses
200
organisationIdstring (uuid)obligatoiretypesstring[]obligatoireaccountsPreferenceAccountDto[]obligatoireAccounts of the member scope
idstring (uuid)obligatoirenamestringobligatoire
itemsPreferenceCellDto[]obligatoiretypestringobligatoire- enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
paymentAccountIdstring (uuid) | nullobligatoireenabledbooleanobligatoireEffective value
explicitbooleanobligatoireFalse when the value comes from the level above or the default
optionsPushOptionsDtoobligatoiredailySummaryTimestringobligatoireLocal time of the daily summary
quietHoursany | nullobligatoiretimeZonestringobligatoireIANA time zone
403permission_denied
Exemples de code
curl -X GET "$KONNECT_API_URL/organisations/id/push/preferences" \
-H "Authorization: Bearer $KONNECT_API_KEY"Exemple : 200
{
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"types": [
"payment_received"
],
"accounts": [
{
"id": "id",
"name": "name"
}
],
"items": [
{
"type": "payment_received",
"paymentAccountId": "paymentAccountId",
"enabled": true,
"explicit": true
}
],
"options": {
"dailySummaryTime": "19:00",
"quietHours": {
"start": "22:00",
"end": "07:00"
},
"timeZone": "Africa/Tunis"
}
}Replace the notification preferences of the signed-in member
PUT/organisations/{id}/push/preferencesClé API
Every stored switch is replaced by items; a type without a row follows the level above, then the default (on, except the daily summary).
Paramètres
idstringpathobligatoire
Corps de la requête application/json
itemsPreferenceSwitchDto[]obligatoireReplaces every stored switch
typestringobligatoire- enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
paymentAccountIdstring (uuid) | nullobligatoireNull: the organisation level row
enabledbooleanobligatoire
optionsPushOptionsDtoobligatoiredailySummaryTimestringobligatoireLocal time of the daily summary
quietHoursany | nullobligatoiretimeZonestringobligatoireIANA time zone
Réponses
200
organisationIdstring (uuid)obligatoiretypesstring[]obligatoireaccountsPreferenceAccountDto[]obligatoireAccounts of the member scope
idstring (uuid)obligatoirenamestringobligatoire
itemsPreferenceCellDto[]obligatoiretypestringobligatoire- enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
paymentAccountIdstring (uuid) | nullobligatoireenabledbooleanobligatoireEffective value
explicitbooleanobligatoireFalse when the value comes from the level above or the default
optionsPushOptionsDtoobligatoiredailySummaryTimestringobligatoireLocal time of the daily summary
quietHoursany | nullobligatoiretimeZonestringobligatoireIANA time zone
400validation_failed
403permission_denied or account_out_of_scope
Exemples de code
curl -X PUT "$KONNECT_API_URL/organisations/id/push/preferences" \
-H "Authorization: Bearer $KONNECT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"type": "payment_received",
"paymentAccountId": "paymentAccountId",
"enabled": true
}
],
"options": {
"dailySummaryTime": "19:00",
"quietHours": {
"start": "22:00",
"end": "07:00"
},
"timeZone": "Africa/Tunis"
}
}'Exemple : corps de la requête
{
"items": [
{
"type": "payment_received",
"paymentAccountId": "paymentAccountId",
"enabled": true
}
],
"options": {
"dailySummaryTime": "19:00",
"quietHours": {
"start": "22:00",
"end": "07:00"
},
"timeZone": "Africa/Tunis"
}
}Exemple : 200
{
"organisationId": "org_01J9Z3K4EXAMPLE0000000000",
"types": [
"payment_received"
],
"accounts": [
{
"id": "id",
"name": "name"
}
],
"items": [
{
"type": "payment_received",
"paymentAccountId": "paymentAccountId",
"enabled": true,
"explicit": true
}
],
"options": {
"dailySummaryTime": "19:00",
"quietHours": {
"start": "22:00",
"end": "07:00"
},
"timeZone": "Africa/Tunis"
}
}