Comment on page
Event
This documentation provides detailed information about the Event Management API, which enables you to manage events, subscriptions, and event publishing in your Neucron application. The API includes the following endpoints:
- 1.Publish Event (
/event/publish
):- Publishes an event with data for subscribers.
- 2.Register Event (
/event/register
):- Registers a new event that subscribers can add webhooks for.
- 3.Subscribe to Event (
/event/subscribe
):- Creates a webhook that is triggered on a new event of the specified code.
- Allows updating webhook details including the URL and keys.
- HTTP Method: POST
- Description: Publishes an event for subscribers.
Request
The request should include the following parameters:
- Headers:
X-Neucron-App-ID
(string, required): The app's unique identifier.X-Neucron-Key-ID
(string, required): The key ID associated with the app.X-Neucron-Key-Secret
(string, required): The secret key associated with the app.
- Body (JSON):
data
(object, required): The event publish request details, conforming to the#/definitions/notifmodel.EventPubReq
schema.
Oops, something is missing.We could not find the original source to display this content.
Example Request Body:
{
"data": {
// Event data here
}
}
Response
- 200 OK: The event was published successfully.Response Body (JSON):{"data": {"message": "Event published successfully."},"status_code": 200}
- 400 Bad Request: An error occurred due to an invalid request body.
- 401 Unauthorized: The request is unauthorized. Ensure that the provided headers are valid.
- 409 Conflict: A conflict occurred.
- 500 Internal Server Error: An internal server error occurred.
- HTTP Method: POST
- Description: Registers a new event that subscribers can add webhooks for.
Request
The request should include the following parameters:
- Headers:
X-Neucron-App-ID
(string, required): The app's unique identifier.X-Neucron-Key-ID
(string, required): The key ID associated with the app.X-Neucron-Key-Secret
(string, required): The secret key associated with the app.
- Query Parameters:
name
(string, required): The name of the event to be registered.
Oops, something is missing.We could not find the original source to display this content.
Response
- 200 OK: The event was registered successfully.Response Body (JSON):{"data": {"message": "Event registered successfully."},"status_code": 200}
- 400 Bad Request: An error occurred due to an invalid request body.
- 401 Unauthorized: The request is unauthorized. Ensure that the provided headers are valid.
- 409 Conflict: A conflict occurred.
- 500 Internal Server Error: An internal server error occurred.
- HTTP Method for Create: POST
- HTTP Method for Update: PATCH
- Description (Create): Creates a webhook that is triggered on a new event of the specified code.
- Description (Update): Updates webhook details, including the URL and keys.
Request
The request should include the following parameters:
- Headers:
X-Neucron-App-ID
(string, required): The app's unique identifier.X-Neucron-Key-ID
(string, required): The key ID associated with the app.X-Neucron-Key-Secret
(string, required): The secret key associated with the app.
- Body (JSON):
subs
(object, required): The webhook details, conforming to the#/definitions/notifmodel.EventSubReq
schema.
Oops, something is missing.We could not find the original source to display this content.
Example Request Body:
{
"subs": {
// Webhook details here
}
}
Response
- 200 OK: The webhook was created or updated successfully.Response Body (JSON):{"data": {"message": "Webhook created/updated successfully."},"status_code": 200}
- 400 Bad Request: An error occurred due to an invalid request body.
- 401 Unauthorized: The request is unauthorized. Ensure that the provided headers are valid.
- 409 Conflict: A conflict occurred.
- 500 Internal Server Error: An internal server error occurred.
This is a reference to the schema defining the parameters required to publish an event.notifmodel.EventSubReq
This is a reference to the schema defining the parameters required to create or update a webhook subscription for an event.
This is a reference to the schema defining client error responses. Please refer to the schema documentation for specific details.
- Event: Use this tag to categorize operations related to event management.
The Event Management API provides a comprehensive set of endpoints to manage events, subscriptions, and event publishing within your Neucron application. You can publish events, register new events, and create/update webhook subscriptions to trigger actions based on specific events.
Make sure to include the required headers and provide valid request bodies to ensure the success of your API calls. In case of any issues, the API will return appropriate error responses for further troubleshooting.
If you need more information about specific schemas or have any questions, please refer to the corresponding documentation or contact the API support team.
Oops, something is missing.We could not find the original source to display this content.
Last modified 3mo ago