HTTP Quickstart

Welcome to mParticle! Let’s send your first event.

Step 1: Generate your API key

Create a Custom Feed on the Setup page to generate server-to-server API credentials.

Step 2: Send an HTTP request

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.

curl

Create data.json with the contents of your request.

{
  "user_identities": {
    "customer_id": "1234",
    "email": "hello@mparticle.com"
  },
  "events": [
    {
      "data": { "event_name": "click" },
      "event_type": "custom_event",
      "custom_attributes": {
        "button_name": "home",
        "other_attribute": "xyz"
      }
    }
  ],
  "environment": "development"
}

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

Postman

Run in Postman

Use our Postman collection to make an HTTP request to the Events API.

Step 3: Verify

Go to the Live Stream and watch new events come in as you send requests.

Next Steps

πŸŽ‰πŸŽ‰πŸŽ‰ Congrats on sending your first event to mParticle!

Some ideas on what to do next:

Was this page helpful?