Create a Custom Feed on the Setup page to generate server-to-server API credentials and store them in a safe place. You’ll need them to make a POST
request in the next step.
Use curl or Postman to send an HTTP request with your access credentials to our server-to-server endpoint https://s2s.mparticle.com/v2/events
.
Create data.json
with the contents of your request.
{
"schema_version": 2,
"environment": "development",
"user_identities": {
"customer_id": "1234",
"email": "hello@mparticle.com"
},
"events": [
{
"data": {
"event_name": "click",
"custom_event_type": "other",
"custom_attributes": {
"button_name": "home",
"other_attribute": "xyz"
}
},
"event_type": "custom_event"
}
]
}
Run curl
from the same directory.
curl -u YOUR_API_KEY:YOUR_API_SECRET -vX POST -H "Content-Type: application/json" -d @data.json https://s2s.mparticle.com/v2/events
Once you’re in the Postman app, follow these steps to make your request:
Username
and Password
in the Authorization tab of the Postman request builder. The Type dropdown on the Authorization tab should be set to Basic Auth for the builder to show those fields.Go to the Live Stream and watch new events come in as you send requests.
Congrats on sending your first event to mParticle!
Some ideas on what to do next:
Was this page helpful?