Community
Showing results for 
Search instead for 
Do you mean 
Reply

POST activity fails (well, response is 500 code, but it is created)

Copper Contributor
Posts: 181
Country: Netherlands

POST activity fails (well, response is 500 code, but it is created)

Hi,

 

can you guys please find out what goes wrong here? As the subject of this post mentiones, the activity is actually created but we're interested in it's created GUID, but the response shows a 500 error.

 

POST /act.web.api/api/organizers/383B0379-1C7E-464C-89A3-757EAEC14644/activities

 

body:

 

{
"activityTypeName": "Verkoop",
"activityPriorityName": "Medium-High",
"subject": "00Dit is de regarding",
"details": "Dit is de details",
"startTime": "2018-07-23T10:00:00Z",
"endTime": "2018-07-23T11:00:00Z",
"location": "Hierzo",
"contacts": [{
"id": "C60DE844-E6EE-4A37-97C1-B60D872E98AE"
}]
}

 

Responsecode: 500 

Response body:

 

{
    "message": "An error has occurred.",
    "exceptionMessage": "ID Must be at least 36 characters",
    "exceptionType": "System.ArgumentException",
    "stackTrace": "   at act.web.api.Services.ActivityService.Split(String ID) in c:\\gitroot\\act.web.api\\act.web.api\\Services\\ActivityService.cs:line 954\r\n   at act.web.api.Services.ActivityService.Get(String id, ActFramework framework, IDictionary`2 mappers) in c:\\gitroot\\act.web.api\\act.web.api\\Services\\ActivityService.cs:line 347\r\n   at act.web.api.Services.ActivityService.Create(ActivityOccurrence activity, Nullable`1 organizerId, ActFramework framework, IDictionary`2 mappers) in c:\\gitroot\\act.web.api\\act.web.api\\Services\\ActivityService.cs:line 198\r\n   at act.web.api.Controllers.ActivitiesController.Post(Guid id, ActivityOccurrence occurrence) in c:\\gitroot\\act.web.api\\act.web.api\\Controllers\\ActivitiesController.cs:line 272\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at act.web.api.Security.SecureMessageAttribute.<ExecuteActionFilterAsync>d__5.MoveNext() in c:\\gitroot\\act.web.api\\act.web.api\\Security\\SecureMessageAttribute.cs:line 160\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Cors.CorsMessageHandler.<SendAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.WebApi.Extensions.Compression.Server.BaseServerCompressionHandler.<SendAsync>d__21.MoveNext() in C:\\Repository\\git\\Microsoft.AspNet.WebApi.MessageHandlers.Compression\\src\\Server\\BaseServerCompressionHandler.cs:line 218\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
}

 

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands
Employee
Posts: 109
Country: USA

Re: POST activity fails (well, response is 500 code, but it is created)

This has been fixed for awhile.  The latest version should take of this issue.

 

FYI:  The organizer Guid must belong to a valid Act User.  If they are just a contact, this does not work.