Skip to main content

Update metadata to a unit card

Service endpoint are subject to change

Method Description#

Update metadata to a given unit card.

note

Metadata key must be unique per organization within the same unit card

For more information, Metadata model

HTTP Request#

PUT https://api.olyn.com/v1/unit-cards/<unit_card_id>/metadata

URL Parameters#

unit_card_id required#

String

The id of the unit card to be retrieved. This must be in string format compliant with ObjectId format.

note

An ObjectId is a 12-byte unique identifier consisting of:

A 4-byte value representing the seconds since the Unix epoch, a 5-byte random value, a 3-byte counter, starting with a random value.


Body Parameters#

key required#

String

Metadata key that will act as identifier of the resource within the unt card. Unique per organization and unit card.


value required#

any

Content of the metadata resource for the unit card. Content can be any type of data, String, Integer, Array, JSON object, etc...


metaType optional#

String

NO_TYPE by default

Set of predefined states used to identify easily certain metadata resources from a unit card. For more information see, Metadata Types.


visibility optional#

String

PUBLIC by default

Set of predefined states used to keep certain metadata resources locked to be only seen by owner and organization that created the resource. For more information see, Metadata Visibility.


Sample Code#

Payload example#

{
"data":
[
{
"key": "metadata_key",
"value": "updated value as string format"
},
{
"key": "MSRPPrice",
"value": [80, "USD"],
"metaType": "PRICE"
},
{
"key": "metdata_key_2",
"value": 30
}
]
}
url = "https://api.olyn.com/v1/unit-cards/617d65b93d30a7b2263fc50f/metadata"
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)

Returns#

Returns an array of Metadata objects.