Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a valid eventId in EventStore?

Tags:

eventstoredb

When I try to post an event without an eventId, I get:

HTTP/1.1 400 Empty eventId provided.

If I populate eventId with something random, then I get:

HTTP/1.1 400 Write request body invalid

In the stdout of the server, I see:

Error converting value "foo" to type 'System.Guid'

What does it take to get a valid EventId?

command:

curl -i -d @event.json localhost:2113/streams/birthday-offer \
     -H "Content-Type:application/vnd.eventstore.events+json"

event.json:

[
  {
     "eventId": "foo",
     "eventType": "bar",
     "data": { 
       "who": "11111111111",
       "which": "birthday-offer"
     }  
  } 
]

I'm not in a .NET language.

like image 692
Jessitron Avatar asked Nov 13 '14 20:11

Jessitron


1 Answers

Just in case anyone else comes across this question, the answer is EventId is a Guid.

According to the docs, you can even omit the EventId and the server will provide the Id for you.

like image 186
Chris Martin Avatar answered Oct 16 '22 08:10

Chris Martin