Exception occurs randomly while Adding bulk routing language or skill to user

URL:/api/v2/users/{userId}/routinglanguages/bulk

{"message":"The version you supplied [422] does not match the current version [423] for entity dxxxxxxxxxxxxxx66e (person)","code":"bad.request","status":400,"contextId":"c7xxxxxxxxxxxxxe7","details":[],"errors":[]}

This means the object you tried to send was outdated. This prevents you from overwriting the entity with old data. Use the current version and try again.

("PATCH", "/api/v2/users/{userId}/routinglanguages/bulk")

I am sending only the id's skill id and user id.

You didn't provide the request body you sent and obscured the context ID preventing me from looking up any information about the request, so I assumed you were sending an incorrect version in the payload as the error indicates. If this is not the case, please open a case with Genesys Cloud Care.

Java SDK:

userId:
"d288d815-578d- - -5202298ba88c";

body :
[{"id":"03383542-1810-4c3d-b75d-e8841f9da3b8","proficiency":3.0,"languageUri":null,"selfUri":null},{"id":"7e1f8a54-4379-477d-ae35-3608909936dd","proficiency":3.0,"languageUri":null,"selfUri":null}]

Request :
RoutingApi.patchUserRoutinglanguagesBulkWithHttpInfo(userId,body);

Response:
{"message":"The version you supplied [468] does not match the current version [469] for entity d288d815- - - ***-5202298ba88c oid=63cfd31a5fc5421b5980e66e (person)","code":"bad.request","status":400,"contextId":"d2154068-88f4-422e-96a9-b1cade747b95","details":[],"errors":[]}

Hi,

This type of error is an optimistic locking error. It usually means some other process or individual has updated the record and you are now operating with an older version of the record. The appropriate response in your code is to reload the record and then re-apply.

One of the more common causes I have seen is when multiple threads or processes are trying to update the record and you have a race condition.

Per Tim's comments, if you are the only process updating the record, I would open a ticket with Genesys Cloud care.

Thanks,
John Carnell
Director, Developer Engagement

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.