Subscribers
Endpoints for managing user subscriptions to status updates via email, SMS, or Slack.
Get Subscriber
Retrieve details for a specific subscriber by their ID.
HTTP Method & URL: GET /api/Subscriber/GetSubscriber/{id}
Authorization: Requires X-API-KEY
Request
- Headers
- Path Parameters
- cURL
| Name | Value | Required | Description |
|---|---|---|---|
X-API-KEY | string | Yes | Your unique API key. |
Accept | application/json | Yes | Expected response format. |
id: (Guid) The unique ID of the subscriber.
curl -X GET "https://stg.itechops.com/api/Subscriber/GetSubscriber/3fa85f64-5717-4562-b3fc-2c963f66afb1" \
-H "X-API-KEY: your_api_key_here" \
-H "Accept: application/json"
Responses
- 200 OK
- 404 Not Found
- 401 Unauthorized
- 500 Server Error
Description: Success. Returns the subscriber details.
Response Body: ApiResponse<SubscribeModel>
{
"Success": true,
"Result": {
"SubscriberId": "3fa85f64-5717-4562-b3fc-2c963f66afb1",
"SubscriberName": "user@example.com",
"SubscriberType": "Email",
"Confirmed": true
},
"Message": ""
}
Description: The subscriber with the specified ID was not found.
Response Body: ApiResponse<null>
{
"Success": false,
"Result": null,
"Message": "Subscriber not found"
}
Description: Authentication failed.
Description: Internal server error.
Response Body: ApiResponse<null>
{
"Success": false,
"Result": null,
"Message": "An unexpected error occurred."
}
Upsert Subscriber
Add a new subscriber or update an existing one.
HTTP Method & URL: POST /api/Subscriber
Authorization: Requires X-API-KEY
Request
- Headers
- Payload
- cURL
| Name | Value | Required | Description |
|---|---|---|---|
X-API-KEY | string | Yes | Your unique API key. |
Content-Type | application/json | Yes | Sending JSON data. |
Body: SubscribeModel
SubscriberType: (String) "Email", "SMS", "Slack", or "Teams".SubscriptionValue: (String) The email address, phone number, or webhook URL.SubscribedComponents: (List<Guid>) List of component IDs to subscribe to.
{
"SubscriberType": "Email",
"SubscriptionValue": "user@example.com",
"SubscribedComponents": ["3fa85f64-5717-4562-b3fc-2c963f66afa0"]
}
curl -X POST "https://stg.itechops.com/api/Subscriber" \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"SubscriberType": "Email",
"SubscriptionValue": "user@example.com",
"SubscribedComponents": ["3fa85f64-5717-4562-b3fc-2c963f66afa0"]
}'
Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 500 Server Error
Description: Success. Subscription created or updated.
Response Body: ApiResponse<Guid>
{
"Success": true,
"Result": "3fa85f64-5717-4562-b3fc-2c963f66afb1",
"Message": "Subscription successful. Please check your email to confirm."
}
Description: Validation error (e.g., invalid email format).
Response Body: ApiResponse<List<string>>
{
"Success": false,
"Result": ["Please provide valid Email"],
"Message": "Validation Error"
}
Description: Authentication failed.
Description: Internal server error.
Response Body: ApiResponse<null>
Confirm Subscription
Confirm a subscription via a unique ID.
HTTP Method & URL: PUT /api/Subscriber/Confirm/{id}
Request
- Path Parameters
- cURL
id: (Guid) The unique confirmation ID.
curl -X PUT "https://stg.itechops.com/api/Subscriber/Confirm/3fa85f64-5717-4562-b3fc-2c963f66afb1"
Responses
- 200 OK
- 500 Server Error
Description: Success. Subscription confirmed.
Description: Error during confirmation.
Unsubscribe
Remove a subscription by ID.
HTTP Method & URL: PUT /api/Subscriber/Unsubscribe/{id}
Request
- Path Parameters
id: (Guid) The unique subscriber ID.
Responses
- 200 OK
- 500 Server Error
Description: Success. Unsubscribed successfully.
Description: Internal server error.
Resend Confirmation Email
Trigger a new confirmation email for a pending subscriber.
HTTP Method & URL: PUT /api/Subscriber/ResendConfirmationEmail/{id}
Responses
- 200 OK
- 500 Server Error
Description: Success. Confirmation email resent.
Description: Internal server error.