User Action Notifications

Group notifications

Account service enables sending a grouped notification to a group of services. That means, that for a given user event if a user belongs to multiple services and that services belong to the same group, Account Service will send only one notification giving information about all the services that the notification is concerning.

Portal notifications

Account service enables sending notifications to a dedicated API if the users account belongs to the given portal

Sending notifications:

Account Service provide functionality that can notify your service/portal about performing an action by a user.

Action that can be configured to triger notifications are:
  • DELETE_ACCOUNT

  • UNASSINGED_FROM_SERVICE

  • PROFILE_CHANGED

If you need your api to be notified about those events, create endpoint according to below hints:

  1. Prepare a public endpoint accepting POST requests

2. Requests are authenticated using Basic authentication. For that client_id and client_secret need to be prepared.

They will be send in Authorization Header.

Example code in python:

import base64

client_id = '2745d640-34e9-4474-93d1-23b9c4f665d4'
client_secret = '043aa101-ed72-4d98-9b08-b01ee35bbdcf'
token = base64.b64encode((client_id + ':' + client_secret).encode()).decode()
headers['Authorization'] = 'Basic ' + token

It’s recommended to verify that the credentials in the Authorization header match the expected ones.

  1. Body of the notification

{
  "notification_type": "DELETE_ACCOUNT",
  "data": {
    "user_id": 123,
    "user_uuid": "dc52b20f-ef78-4789-b6c4-eb10b670bc89",
    "user_email":  "joe@example.com"
    "timestamp": 1672931435,
    "services": {
      "1" : 1102020202,
      "2" : null
    }
  }
}
  1. Api Response

Your api should return 200 OK - response needs to be idempotent that means when more than one requests with same user_id_in_service occur, your api should still return 200 OK for all of them.

Example request

curl -x POST 'https://example-service.com/user-action-notify
-d '{
      "notification_type": "DELETE_ACCOUNT",
      "data": {
        "user_id": 123,
        "user_uuid": "dc52b20f-ef78-4789-b6c4-eb10b670bc89",
        "user_email":  "joe@example.com"
        "timestamp": 1672931435,
        "services": {}
      }
    }' --header 'Authorization: Basic OWMzMjkxMjYtYWVmNC00M2Q5LWIxNTEtMDM2Y2I4NDI4YjExOjZlODFhYzk3LTA5MzgtNGI1Mi1hNWJkLThiNzg1YTJkN2M4YQ=='