Discover how to integrate and manage your notification system with our simple yet powerful messaging service.
You'll need:
For MsgGO to send messages to your configured delivery targets, you first need to deliver an event to MsgGO. When MsgGO receives your event, it processes it according to your configuration and sends appropriate messages to all configured delivery targets.
You can deliver events to MsgGO in two simple ways:
MsgGO offers flexibility in how you can provide your API key. This is useful because events might be sent from various systems and external services where you don't always have full control over the request format. You can deliver the API key in four ways:
You can include the API key directly in the URL path.
https://msggo.io/inbox/YOUR_API_KEY?event=your-event
curl "https://msggo.io/inbox/YOUR_API_KEY?event=deploy_done&status=success"
The API key can be sent as a query parameter named msggo-key
.
https://msggo.io/inbox?msggo-key=YOUR_API_KEY&event=your-event
curl "https://msggo.io/inbox?msggo-key=YOUR_API_KEY&event=user_registered&email=test@example.com"
For POST requests, the API key can be part of the request body as a field named msggo-key
.
{
"msggo-key": "YOUR_API_KEY",
"event": "your-event",
"data_field": "value"
}
curl -X POST "<https://msggo.io/inbox>" \
-d '{"msggo-key":"YOUR_API_KEY","event":"payment_processed","amount":100}'
curl -X POST "https://msggo.io/inbox" \
-d "msggo-key=YOUR_API_KEY" \
-d "event=form_submission" \
-d "customer_id=123"
The most recommended method is to send the API key in the X-MsgGO-Key
HTTP header.
X-MsgGO-Key: YOUR_API_KEY
curl -X POST "https://msggo.io/inbox" \
-H "X-MsgGO-Key: YOUR_API_KEY" \
-d '{"event":"backup_completed","status":"success"}'
MsgGO detects the API key in the following order of priority:
X-MsgGO-Key
/inbox/YOUR_API_KEY
msggo-key
msggo-key
For MsgGO to process your event and send appropriate notifications, you need to deliver its content. You can do this in several ways:
You can send event data as query parameters in the URL. This applies to both GET and POST requests. All query parameters (except msggo-key
) will be converted into fields of a JSON document.
Example (GET or POST):
https://msggo.io/inbox?msggo-key=YOUR_API_KEY&event=contact-form&name=John%20Doe&email=john.doe@example.com>
{
"event": "contact-form",
"name": "John Doe",
"email": "john.doe@example.com"
}
For POST requests, you can send event data as standard form fields (application/x-www-form-urlencoded
). These fields will also be converted into a JSON document.
curl example:
curl -X POST "https://msggo.io/inbox" \
-H "X-MsgGO-Key: YOUR_API_KEY" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "event=new_order" \
-d "product_id=XYZ123" \
-d "quantity=2"
{
"event": "new_order",
"product_id": "XYZ123",
"quantity": "2" // Note: values from form data are typically strings
}
This is the preferred method for complex data. You send a full JSON document in the body of the POST request with the Content-Type: application/json
header.
curl example:
curl -X POST "<https://msggo.io/inbox>" \
-H "X-MsgGO-Key: YOUR_API_KEY" \
-d '{
"event": "system_alert",
"severity": "critical",
"details": {
"host": "server01",
"metric": "cpu_usage",
"value": "95%"
}
}'
MsgGO allows you to combine data sent as query parameters with data sent in the POST request body (both application/x-www-form-urlencoded
and application/json
). This data will be merged into a single JSON document. In case of conflicting field names, values from the POST request body take precedence over values from query parameters.
If your request to MsgGO does not include a Content-Type header, MsgGO will automatically interpret the request body as a JSON document. To ensure correct processing, verify that data sent without this header is in valid JSON format.
You can send events directly to MsgGO from your frontend applications (e.g., websites running in a browser, mobile apps) using a Public API Key.
Even with the ability to use Public API Keys, a backend proxy might still be the preferred approach in certain scenarios:
If you exceed delivery target rate limits, message delivery will be paused, and you'll receive a notification in MsgGO.
Instead of sending events directly from your frontend, create a backend endpoint that receives the event data from your frontend and then forwards it to MsgGO. This keeps your API key secure on your server.
// Safe frontend implementation - sends data to your backend
async function sendEventToBackend(eventData) {
try {
const response = await fetch('https://your-backend.com/api/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
event_name: 'user-action',
...eventData
})
});
const result = await response.json();
return result;
} catch (error) {
console.error('Error sending event:', error);
throw error;
}
}
// Example usage
sendEventToBackend({
action: 'button_click',
page: 'homepage',
timestamp: new Date().toISOString()
});
When delivering events to MsgGO, you might encounter various error responses. Understanding these errors will help you troubleshoot delivery issues effectively:
If your API key is invalid or missing, the endpoint will return:
{
"ok": false,
"statusCode": 401,
"message": "API key missing in the request"
}
msggo-key
parameter in your request or X-MsgGO-Key
header
If your JSON payload exceeds the maximum size limit, you'll receive:
{
"ok": false,
"statusCode": 413,
"message": "Payload too large"
}
In the following sections, you'll find examples of how to deliver events using different programming languages. However, before implementing these in your code, you might want to test if your events are properly received by MsgGO. You can do this using tools like Postman, curl, or even your web browser.
The simplest way to test event delivery is using your web browser. Just paste the URL with your API key and event parameters into your browser's address bar:
https://msggo.io/inbox?msggo-key=YOUR_API_KEY&event=your-event-name
MsgGO provides a built-in testing feature in its interface. To send a test event:
This feature is particularly useful when you want to:
# GET
curl "https://msggo.io/inbox?msggo-key=YOUR_API_KEY&event=your-event-name"
# POST
curl -X POST "https://msggo.io/inbox" \
-d '{"msggo-key":"YOUR_API_KEY","event":"your-event-name"}'
X-MsgGO-Key
header is a clean and standard approach.
Content-Type
header (e.g., application/json
) is recommended to avoid ambiguity.
Currently, MsgGO supports a set of predefined delivery targets. We're constantly adding new integrations based on user needs.
No practical limits exist. You can create tens of thousands of events and delivery targets.
Events are processed immediately when received by MsgGO.