API
Sending events
The same as Segment's HTTP API. Send your write key as the Basic auth username, or as writeKey in the body. It answers 200 unless the body isn't JSON or is too big, so a tracking call can't break your site. An event can be 32 KB, and a batch 500 KB and 2,500 events.
curl https://harrowsoft.com/fragment/v1/track -u WRITE_KEY: -H "content-type: application/json" \
-d '{"userId": "u1", "event": "Signed Up", "properties": {"plan": "Pro"}}'
| POST /fragment/v1/track | userId or anonymousId, event, properties. |
| POST /fragment/v1/identify | userId or anonymousId, traits. |
| POST /fragment/v1/page | userId or anonymousId, name, properties. |
| POST /fragment/v1/screen | The same, for apps. |
| POST /fragment/v1/group | groupId, traits. |
| POST /fragment/v1/alias | previousId, userId. |
| POST /fragment/v1/batch | batch: a list of the above, each with a type. |
Managing it from a script
Make a token on your tokens page, and send it as Authorization: Bearer hs_.... It can do what you can, no more.
| GET /overview | The last 24 hours, sources and destinations. |
| GET /sources | Your sources and their write keys. |
| POST /sources | name. |
| GET /destinations | Your destinations. Secrets never come back. |
| POST /destinations | kind, name, config. |
| GET /destination/{id} | One, with its recent failures. |
| PATCH /destination/{id} | name, config, on, filter. |
| POST /destination/{id}/test | Sends one test event, and says what the tool said. |
| POST /destination/{id}/replay | days: send the last few days again. |
| GET /events/list | Newest first. q finds an ID or event name, only_failed=true narrows it. |
| GET /event/{id} | The trace: what came in, what each tool was sent and what it said. |
| GET /schema | Every event, its fields and anything strange. |
| POST /schema/plan | type, name, planned; or all, planned. |
| GET /people | q finds an ID or trait. |
| GET /person/{id} | Their IDs, traits and timeline. |
| POST /import/segment | token. Admins only. |