Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
sshipway
4 years agoOccasional Contributor
templateUuid error when trying to create secret via Ruby SDK
I am trying to create a new Secret in a 1Password vault via the Connect API (container 1.5.1), using the Ruby gem SDK (0.1.3)
I am calling the api with:
item = op.create_item(vault_id: vau...
sshipway
4 years agoOccasional Contributor
@Jillian_1P - Thanks for taking a look.
I read the 1P API documentation here - https://developer.1password.com/docs/connect/connect-api-reference/#add-an-item
The Ruby SDK is just a wrapper for the API, and I pass it the same JSON block (see above).
I pass a Category parameter, same as in the documentation, but not a templateUuid parameter - I take it that this is the same thing?
It's not clear, but am I passing the Fields array correctly? I am not sure if you need id/type/purpose/value/label to all be set, particularly for username, password and notes. Also there is inconsistency in that the Item object example in the doc shows these fields with id/type/label defined but the Field object definition in the doc seems in indicate that Type is not required if you have Purpose, and Id and Label are not mentioned at all.
If this is the cause, then the error message being generated is a bit misleading