Session Event Structure

I’m having an issue sending HTTP requests to report session data. Our project at the moment is using the Unreal endpoint for crash reporting, but I wanted to add session related data so we could get release health information. After looking at the docs here and here I thought I had a good idea what was going on but I’m consistently getting a response code of 400 with this reason: “detail”:“invalid JSON data”,“causes”:[“trailing characters at line 2 column 1”.

The content I’m sending is this:

{}\n{“type”:“session”}\n{“started”:“2020-02-07T14:16:00Z”,“attrs”:{“release”:“sentry-test@1.0.0”}}

This response is confusing since this content is taken directly from the docs about envelopes and sessions. The error seems to be pointing to the newline character but from what I read in the docs about envelopes those are required. A request with content of {“type”:“session”} is accepted with a response code of 200 which is probably unsurprising. {“type”:“session”}\n is also fine but {“type”:“session”}\n{} is rejected.

I feel like I’m missing something pretty obvious so any direction to fix this would be very much appreciated.

It looks like my main issue was that I was sending the envelope to the store endpoint by mistake.