@ POST @ Path ( "/{name}" + ServerAPI . GET_CORPORATE_GROUPIDS ) public Response addCorporateGroupIdPrefix ( @ Auth final DbCredential credential , @ PathParam ( "name" ) final String organizationId , final String corporateGroupId ) { LOG . info ( "Got an add a corporate groupId prefix request for organization " + organizationId + "." ) ; if ( ! credential . getRoles ( ) . contains ( DbCredential . AvailableRoles . DATA_UPDATER ) ) { throw new WebApplicationException ( Response . status ( Response . Status . UNAUTHORIZED ) . build ( ) ) ; } if ( corporateGroupId == null || corporateGroupId . isEmpty ( ) ) { LOG . error ( "No corporate GroupId to add!" ) ; throw new WebApplicationException ( Response . serverError ( ) . status ( HttpStatus . BAD_REQUEST_400 ) . entity ( "CorporateGroupId to add should be in the query content." ) . build ( ) ) ; } getOrganizationHandler ( ) . addCorporateGroupId ( organizationId , corporateGroupId ) ; return Response . ok ( ) . status ( HttpStatus . CREATED_201 ) . build ( ) ; }
Add a new Corporate GroupId to an organization .