How to create Events via REST?

The REST docs for creating Events is incomplete, so I tried to figure it out with some trial and error, but I hit a brick well.

I created an event manually and then fetched it with the REST API to get a list of the Event properties, then tried using that to create a new event.  After several iterations of using all of the properties, none of them, some of them, and some other variations (like passing Title instead of EventTitle), I only ever received this error message.

{
    "": null,
    "Errors": [
        "An unexpected error prevented your requested action from completing. The error has been logged for the administrator to review."
    ]
}

When I reviewed the Admin Console integration logs I found this stack trace, which didn't do much to help me track down the issue.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telligent.Evolution.Calendar.Plugins.RestApi.Implementation.Events.EventCreateRequest..ctor(IRestRequest request)
   at Telligent.Evolution.Calendar.Plugins.RestApi.CalendarRouteRegistrar.<>c.(IRestRequest )
   at Telligent.Evolution.Rest.Framework.Infrastructure.RestPluginHttpHandler.ProcessRequest(HttpContextBase context, HttpResponse httpResponse)

Here is an example request that I sent to the server.  I confirmed that Calendar ID 1 does exist.

POST /api.ashx/v2/calendars/1/events.json HTTP/1.1
Host: abc.telligentdemo.com
Rest-User-Token: xxxxxxxxxx
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

EventTitle=Happy+Day!&EventStartDate=2018-02-09T12%3A00%3A00&EventEndDate=2018-02-09T13%3A00%3A00&EventDescription=%3Cp%3EThis+is+an+event!%3C%2Fp%3E%3Cdiv+style%3D%5Cclear%3Aboth%3B%5C%3E%3C%2Fdiv%3E&EventLocation=Here&EventReferenceUrl=http%3A%2F%2Fexample.com%2Fevents%2F1&AllowAnonymousRegistrations=false&IsCancelled=false&RegistrationType=0

Here is a readable version of the params and values.

EventTitle: Happy Day!
EventStartDate: 2018-02-09T12:00:00
EventEndDate: 2018-02-09T13:00:00
EventDescription: <p>This is an event!</p><div style=\clear:both;\></div>
EventLocation: Here
EventReferenceUrl: http://example.com/events/1
AllowAnonymousRegistrations: false
IsCancelled: false
RegistrationType: 0

Help? :-/

Parents
  • Unfortunately, there is an internal error that prevents this API from working. I've logged the bug for review:

    The only work-around would be to create a widget that can handle the same request and calling it through the scripted REST endpoint: community.telligent.com/.../post-scripting-rest-endpoint

Reply
  • Unfortunately, there is an internal error that prevents this API from working. I've logged the bug for review:

    The only work-around would be to create a widget that can handle the same request and calling it through the scripted REST endpoint: community.telligent.com/.../post-scripting-rest-endpoint

Children
No Data