Notification Service

The MSDN Notification Service provides a robust and scalable mechanism for sending real-time notifications to users across various platforms. This service is designed to be highly available and can be integrated into your applications to keep users informed about important events, updates, and alerts.

Overview

This service allows applications to:

API Endpoints

The Notification Service exposes RESTful APIs for interacting with its functionalities.

Sending Notifications

POST /notifications

Sends a notification to one or more recipients.

Request Body (JSON)
        {
          "recipientIds": ["user123", "user456"],
          "channels": ["email", "push"],
          "subject": "Important Update Available",
          "message": "A new version of the application is ready for download.",
          "metadata": {
            "deepLink": "myapp://updates/latest",
            "priority": "high"
          }
        }
        
Request Body Parameters
Parameter Type Description Required
recipientIds Array of Strings A list of unique user identifiers for the recipients. Yes
channels Array of Strings Specifies the channels to send the notification through (e.g., "email", "push", "sms"). Yes
subject String The subject or title of the notification. No
message String The main content of the notification. Yes
metadata Object Optional additional data to be included with the notification. Can be used for deep linking, priority, or other custom information. No
Response (JSON)
        {
          "notificationId": "notif_abc123xyz",
          "status": "sent",
          "sentAt": "2023-10-27T10:00:00Z"
        }
        

Managing Preferences

GET /users/{userId}/preferences

Retrieves the notification preferences for a specific user.

PUT /users/{userId}/preferences

Updates the notification preferences for a specific user.

Note: When sending notifications, ensure that the recipientIds correspond to valid users in the system. Invalid identifiers will be ignored or may result in an error, depending on the configuration.

Supported Channels

Configuration

Users can manage their notification preferences through their profile settings or by using the dedicated preference management API endpoints. This includes opting in/out of specific notification types or channels.

Error Handling

The service returns standard HTTP status codes. Common errors include:

Detailed error messages are provided in the response body for debugging purposes.