Unable to Create Organisation through GroupShare API

I'm building an application which communicates with GroupShare using the REST API, and am encountering an exception when I try to create an organisation.

First of all, we built our own API wrapper to communicate with the GroupShare REST API, and we had this successfully creating orgnisations. For our own reasons we had to create a new VM on which GroupShare is installed, which then required a fresh install of GroupShare on said VM. Since then our API wrapper encounters the aforementioned exception.

I've also tried using Romulus' GroupShareKit, and although both this and our wrapper API can authenticate against the GroupShare server, then query and successfully obtain the root organisation, we still encounter the same exception when sending the request to create a new organisation.

[I should add that I've had to fork and modify GroupShareKit to include an Organziations.Create method - pull request possibly coming soon.]

As per the instructions here, this is the JSON which I'm POSTing to the server:

{
    "UniqueId": "e21c9e02-8b4c-4274-9b9c-8ec76f85863a",
    "Name": "86031",
    "Description": "Test Groupshare Org",
    "Path": "/86031",
    "ParentOrganizationId": "f82b6604-9a9e-47bb-90c1-d907b9db7594",
    "ChildOrganizations": []
}

Other things I've tried:

  • not setting "UniqueId" - if not set then I can see that an empty GUID ("00000000-0000-0000-0000-000000000000") is sent
  • setting "Path" as "/"
  • setting "ChildOrganizations" to NULL

None of the above makes any difference. The response is always:

{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Object reference not set to an instance of an object.",
    "ExceptionType": "System.NullReferenceException",
    "StackTrace": "   at Sdl.StudioServer.Services.Management.RestApi.Controllers.OrganizationsController.AddOrganization(Organization organization)
                    at lambda_method(Closure , Object , Object[] )
                    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)
                    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
                    at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()
                    at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"
}


In case it matters, the username and password are those pre-configured for the "sa" user, and no other configuration has taken place on GroupShare other than as required during the installation procedure.

Parents Reply
  • >> Can you please let me know what you changed to fix the problem?

    I've gradually wound backwards and found that I can now create organisations under the root using the 'sa' login, which I couldn't earlier. Therefore the only change seems to be the GroupShareKit version.
    The only other aspect which has changed is that there is now another organisation and user in the system, though like I said, I'm able to ignore these and achieve what I couldn't before.

    >> Also you are now using our latest version from nuget or the one which is custom built by you?

    I'm using the version which I built on this PC. I'll try the NuGet version right now.


    UPDATE: Yes, it also works with the NuGet package.

Children