Skip to main content
Question

How to use Rest API PUT Call Properly

  • January 30, 2023
  • 3 replies
  • 256 views

Forum|alt.badge.img

We are trying to update one credential attribute from credential vault using REST API PUT process but after running it , it is giving us the below error - 

{"code":"optimistic.lock.exception","correctiveAction":"To continue, please try again.","details":"Unable to save your changes because this object may have been edited by someone else.","message":"Unable to save changes"}

Can anyone suggest what should we do in order to save the changes, or how can we update variable using another API call ?
 

3 replies

rbkadiyam
Premier Pathfinder | Tier 7
Forum|alt.badge.img+17
  • Premier Pathfinder | Tier 7
  • January 30, 2023

@Sayan.D1 

Check the attached document


Forum|alt.badge.img+1
  • Cadet | Tier 2
  • May 22, 2023

I tried doing the same but this isn’t getting resolved. What else can be done? 


Forum|alt.badge.img
  • Cadet | Tier 2
  • March 4, 2025

Hi Sayan, 

Same scenario I encountered and I think I find the solution.

  1. use Return Attribute value API to get the version of attribute.
  2. when using Update Attribute value, specify the version number you get and I believe it will be successfully updated.

 

Get  version number

    "list": [

        {

            "id": "4457",

            "credentialAttributeId": "7223",

            "value": "",

            "createdBy": "30801",

            "createdOn": "2025-02-25T09:42:30.117636300Z",

            "updatedBy": "30801",

            "updatedOn": "2025-03-04T07:43:38.476616300Z",

            "version": "5",

            "password": false

        },

 

Put new value

{

  "value": "newvalue",

  "version": "5"

}