1Password/connect

How to update a password item with the REST API?

BaesKevin opened this issue · 3 comments

Hi,

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

  • using the PUT /v1/vaults/{vaultUUID}/items/{itemUUID} operation does not work because then we also have to set things like the entropy and password strength (which should be generated by 1password)
  • using the PATH /v1/vaults/{vaultUUID}/items/{itemUUID} operation does not work because there's no way to reference the password value, something like "path": "fields/password/value" obviously because it's an array of fields

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

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

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}

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