← Back to team overview

dhis2-devs team mailing list archive

WebAPI : New way to assign an orgUnit to an orgUnitGroup?

 

Hi All

In older versions of DHIS (pre 2.26), one could assign an OrgUnitGroup to
an OrgUnit using the following Ajax call:

var posturl = base + 'api/organisationUnitGroups/' + ouGroupUID +
'/organisationUnits/' + ouUID + '.json';
    $.ajax({
        url: posturl,
        type: "PUT",
        dataType: "text",
        contentType: "application/json; charset=utf-8",
        async: false,
        success: function (response) {
            console.log("OrgUnit Group update successful");
        }
    });

Now on 2.27 the WebAPI returns the following response:

{"httpStatus":"Method Not
Allowed","httpStatusCode":405,"status":"ERROR","message":"Request method
'PUT' not supported"}

So what is the solution to achieve the above goal in 2.27?

Regards
-- 
Farai Mutero

Follow ups