Is there a defined format for item json responses

I'm trying to write a CLI wrapper around the CLI tool, and I'm trying to parse the json into structs. I can't find the json format anywhere. If it exists in the documentation, where is it? Thanks.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided

Comments

  • I'm also interested in this as the format seems to vary quite a bit between templates. For example:

    • Login has "fields" with "designation", "name", "type", and "values"

    • Password just has "password"

    • Most (all?) items have "sections", those have a "name", a "title" and "fields". But these "fields" are different than Login "fields", they have "k", "n", "t", and "v" which seem to be analogous to "designation", "name", "type", and "values" despite being named differently and possibly in a different order.

    I think I see how it fits together, but it would be great to have something like a JSON schema that lays out what fields are available for each template --- this would cut down on the amount of assumption and guesswork.

  • felix_1pfelix_1p

    Team Member

    @iansaccount , @csharpsteen Sorry for the late reply.

    As you can imagine we are not necessarily happy with the structure and its sometimes cryptic field names. That's why are working on a simplified structure.

    But @csharpsteen pretty much figured it out. Login and Password items are slightly different for historical reasons. Regardless, every item stores data in fields inside sections, where each fields consists of

    • K the field type.
    • N the (internal) field name
    • T the (user visible) field title
    • V the field value. Most often than not it's just a string, but there are some field types (e.g. address) for which the value is more complex.

    To the best of my knowledge we don't have a comprehensive list of standard fields for the available item types, so looking at the templates themselves (op get template) is your best bet atm. But I will double check on that.

  • MrCMrC Community Moderator

    @csharpsteen ,

    Look at the Utils/PIF.pm file in the converter suite.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file