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: vaultid, body: attributes)
...after first verifying I have successfully connected, and obtaining the Vault ID from other calls. However, this is always giving the response:
POST https://myhostnameisinhere/v1/vaults/vaultidishere/items: 400 - Validation: (validateVaultItem failed to Validate), Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. Required field \"item.templateUuid\" not found}"
This would seem to indicate that a templateUuid parameter is required; however, what is this? It is not mentioned in the API documentation, and even adding it to the passed attributes structure doesn't help.
This is the structure I am passing:
attributes = {
title: secretname,
tags: [
"api"
],
vault: {
id: vaultid
},
category: "LOGIN",
fields: [
{
id: "username",
type: "STRING"
purpose: "USERNAME",
label: "username",
value: username,
},
{
id: "password",
type: "CONCEALED",
purpose: "PASSWORD",
label: "password",
value: newpass,
},
{
id: "notesPlain",
type: "STRING",
purpose: "NOTES",
label: "notesPlain",
value: "Created by API"
}
]
}
What am I missing here?
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
