JavaScript
async function subscribeToAlert(alertId, userId) { const url = `/api/social/v4/alerts/${alertId}/subscriptions`; const response = await fetch(url, { body: JSON.stringify({ subscriberId: userId, type: 'USER' }), }); return await response.json();}
{}
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The alertId
Returns the parameter of success or error based on the alert id being valid.
The response is of type object.
object