1

I'm using the Keen.IO .NET sdk and I can't seem to override the keen.timestamp property. I keep receiving the error:

value of property keen must be an object, is newtonsoft.json.linq.jproperty"}

If I remove the keen property, then the event saves fine, but the keen.timestamp throws an error, if added. The KeenClient.AddEvent() seems to check for a JObject but I'm not sure why JProperty is being found. Any ideas? Thanks in advance!

Here's my test code:

 var aEvent = new
    {
    keen = new[] { new { timestamp = "2000-05-30T12:12:12Z" } },
    username = user,
    position = i,
    event_id = "A123",
    score = new Random().Next(1, 11),
    demographics = new[] { new {gender = "M", city = "San Francisco", state = "CA"}}
    };
    keenClient.AddEvent("events_test", aEvent);
Mark
  • 13
  • 2

1 Answers1

0

It looks like the keen property in the event is an Object[], not just an Object. Try it just as an object and see if that works.

Josh Dzielak
  • 1,803
  • 17
  • 19
  • Using just an Object worked. Thanks! Upadted line: keen = new { timestamp = "2000-05-30T12:12:12Z" }, – Mark Nov 09 '14 at 04:00