I’m trying to create release though the rest api.
I’m able to view all releases on a project at this api endpint
GET /api/projects/Projects-1/releases
According to the API documentation, to create a new release you access this endpoint
POST /api/releases
Yet no matter what I try, I get this error
{
"ErrorMessage": "Value cannot be null.\r\nParameter name: instance",
"FullException": "Value cannot be null.\r\nParameter name: instance\r\nSystem.ArgumentNullException\r\n at System.ComponentModel.DataAnnotations.ValidationContext..ctor(Object instance, IServiceProvider serviceProvider, IDictionary`2 items)\r\n at Nancy.Validation.DataAnnotations.DataAnnotationsValidatorAdapter.Validate\r\n at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\r\n at Nancy.Validation.DataAnnotations.PropertyValidator.Validate(Object instance, NancyContext context)\r\n at Nancy.Validation.DataAnnotations.DataAnnotationsValidator.Validate(Object instance, NancyContext context)\r\n at Octopus.Server.Web.Infrastructure.Api.Responder`1.BindAndValidate[TModel]() in Responder.cs:line 65\r\n at Octopus.Server.Web.Infrastructure.Api.CreateResponseDescriptor`2.Responder.Execute() in CreateResponseDescriptor.cs:line 0\r\n at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Responder.cs:line 145\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in OctopusRestApiModule.cs:line 46\r\n at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)"
}
I’ve tried
POST /api/releases
POST /api/releases?Version=1.0.1
POST /api/releases?Version=1.0.1?ProjectID=Projects-1
How can I create a release though the API?