Resource REST API not able to update user groups
search cancel

Resource REST API not able to update user groups

book

Article ID: 242321

calendar_today

Updated On:

Products

Clarity PPM SaaS

Issue/Introduction

I am trying to create a REST PUT / PATCH request for updating a resource / user groups, I always get below error.

{
"resourceId": "12345",
"httpStatus": "400",
"errorMessage": "CMN-0016: Attribute 'user_groups' has an invalid value",
"errorCode": "validation.invalidValue"
}

Request Body:
{
"lastName": "Smith",
"secondaryEmail": "[email protected]", 
"externalId": "[email protected]",
"resourceName": "20022670",
"userName": "[email protected]",
"_internalId": 12345,
"firstName": "John",
"email": "[email protected]",
"language": "1",
"status": "202",
"userGroups": { 
"displayValue": "Basic group for user access",
"id": "5000323"
}
}

 

Resolution

The correct syntax to update User Groups should be

 

{"lastName":"Last","lastUpdatedBy":"abc, abc","secondaryEmail": [email protected],"externalId": [email protected],"resourceName":"20022670","userName": [email protected],"_internalId":5134544,"firstName":"First","lastUpdatedDate":"2022-05-18T14:24:46","createdDate":"2020-11-17T10:45:25","createdBy":"abc, abc","company": null,"middleName": null,"email": [email protected],"status":"200","locale":"en_GB","language":"2","timezone":"Australia/Sydney","userGroups": ["5000323","5214546"]}