Aller au contenu

Environnement de développement : contenu en cours de rédaction, rien ne pointe vers la production.

Sommaire de la documentation

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

    • webPushWebPushConfigDtoobligatoire
      • enabledbooleanobligatoire
      • publicKeystring | nullobligatoire

        VAPID public key (base64url) for PushManager.subscribe

    • fcmProviderStateDtoobligatoire
      • enabledbooleanobligatoire

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

  • endpointstringquery

    Endpoint or token of this browser or app, to mark it current

Réponses

  • 200

    • idstring (uuid)obligatoire
    • platformstringobligatoire
      • enum: "web", "android", "ios"
    • labelstringobligatoire
    • localestringobligatoire
      • enum: "fr", "en"
    • organisationIdstring (uuid) | nullobligatoire
    • createdAtstringobligatoire
    • lastSeenAtstringobligatoire
    • currentbooleanobligatoire

      The device of the registration or of the endpoint query

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"
  • tokenstring

    FCM registration token (android, ios)

  • subscriptionany

    Web 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)obligatoire
    • platformstringobligatoire
      • enum: "web", "android", "ios"
    • labelstringobligatoire
    • localestringobligatoire
      • enum: "fr", "en"
    • organisationIdstring (uuid) | nullobligatoire
    • createdAtstringobligatoire
    • lastSeenAtstringobligatoire
    • currentbooleanobligatoire

      The device of the registration or of the endpoint query

  • 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[]obligatoire
      • idstring (uuid)obligatoire
      • deviceIdstring (uuid)obligatoire
      • deviceLabelstringobligatoire
      • typestringobligatoire
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
      • organisationIdstring (uuid) | nullobligatoire
      • statusstringobligatoire
        • 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"
      • titlestringobligatoire
      • bodystringobligatoire
      • urlstringobligatoire

        Relative deep link of the dashboard

      • createdAtstringobligatoire
      • sentAtstring | 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

  • cursoranyquery
  • limitintegerquery
    • max: 100
    • default: 20

Réponses

  • 200

    • itemsPushDeliveryDto[]obligatoire
      • idstring (uuid)obligatoire
      • deviceIdstring (uuid)obligatoire
      • deviceLabelstringobligatoire
      • typestringobligatoire
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary", "test", "onboarding_reminder", "document_reviewed"
      • organisationIdstring (uuid) | nullobligatoire
      • statusstringobligatoire
        • 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"
      • titlestringobligatoire
      • bodystringobligatoire
      • urlstringobligatoire

        Relative deep link of the dashboard

      • createdAtstringobligatoire
      • sentAtstring | 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)obligatoire
    • typesstring[]obligatoire
    • accountsPreferenceAccountDto[]obligatoire

      Accounts of the member scope

      • idstring (uuid)obligatoire
      • namestringobligatoire
    • itemsPreferenceCellDto[]obligatoire
      • typestringobligatoire
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
      • paymentAccountIdstring (uuid) | nullobligatoire
      • enabledbooleanobligatoire

        Effective value

      • explicitbooleanobligatoire

        False when the value comes from the level above or the default

    • optionsPushOptionsDtoobligatoire
      • dailySummaryTimestringobligatoire

        Local time of the daily summary

      • quietHoursany | nullobligatoire
      • timeZonestringobligatoire

        IANA 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[]obligatoire

    Replaces every stored switch

    • typestringobligatoire
      • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
    • paymentAccountIdstring (uuid) | nullobligatoire

      Null: the organisation level row

    • enabledbooleanobligatoire
  • optionsPushOptionsDtoobligatoire
    • dailySummaryTimestringobligatoire

      Local time of the daily summary

    • quietHoursany | nullobligatoire
    • timeZonestringobligatoire

      IANA time zone

Réponses

  • 200

    • organisationIdstring (uuid)obligatoire
    • typesstring[]obligatoire
    • accountsPreferenceAccountDto[]obligatoire

      Accounts of the member scope

      • idstring (uuid)obligatoire
      • namestringobligatoire
    • itemsPreferenceCellDto[]obligatoire
      • typestringobligatoire
        • enum: "payment_received", "payment_failed", "webhook_not_confirmed", "daily_summary"
      • paymentAccountIdstring (uuid) | nullobligatoire
      • enabledbooleanobligatoire

        Effective value

      • explicitbooleanobligatoire

        False when the value comes from the level above or the default

    • optionsPushOptionsDtoobligatoire
      • dailySummaryTimestringobligatoire

        Local time of the daily summary

      • quietHoursany | nullobligatoire
      • timeZonestringobligatoire

        IANA 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"
  }
}