1Password / connect

Access your 1Password secrets using a 1Password Connect Server
https://developer.1password.com/docs/connect
149 stars 28 forks source link

How to update a password item with the REST API? #58

Open BaesKevin opened 1 year ago

BaesKevin commented 1 year ago

Hi,

I'm trying to programmatically update a password via the REST API, but the two options we see have issues:

Is there a way to do this with the REST API?

BaesKevin commented 1 year ago

managed to fix it, I was sending a wrong request, the documentation was a bit unclear for me and would benefit from an example

PATCH /v1/vaults/{vaultUUID}/items/{itemUUID}

[
    {
        "op": "replace", 
        "path": "fields/password/value",
        "value": "somepassword"
    }
]
wpted commented 1 year ago

A little fix here, the actual request body is

[
    {
        "op": "replace",
        "path": "/fields/password/value",
        "value": "somepassword"
    }
]

under endpoint PATCH /v1/vaults/{vaultUUID}/items/{itemUUID}

abdosaeedelhassan commented 1 month ago

Hi all, any updates her please, i also used patch like next array:4 [ 0 => array:3 [ "op" => "replace" "path" => "title" "value" => "sdsdsd" ] 1 => array:3 [ "op" => "replace" "path" => "/fields/notesPlain/value" "value" => "dfdfd" ] 2 => array:3 [ "op" => "replace" "path" => "/fields/credential/value" "value" => "fdfdf" ] 3 => array:3 [ "op" => "replace" "path" => "/fields/hostname/value" "value" => "fdfdf" ] ] but also give me Invalid request body or parameter