Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BaesKevin opened this issue Feb 3, 2023 · 3 comments
Open

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

BaesKevin opened this issue Feb 3, 2023 · 3 comments

Comments

@BaesKevin
Copy link

BaesKevin commented Feb 3, 2023

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?

@BaesKevin
Copy link
Author

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
Copy link

wpted commented Apr 11, 2023

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
Copy link

abdosaeedelhassan commented Jun 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants