Skip to main content

Redeem unit card

Service endpoint are subject to change

Method Description#

Redeem unit card created via Create a unit card by redemption

HTTP Request#

POST https://api.olyn.com/v1/unit-cards/_actions/redeem

URL Parameters#

None

Body Parameters#

redemption code required#

String

The redemption code from the response of Create unit card by redemption.

For example, "276c72d6-9de5-4b35-bed1-4b9e6f0ff159"


owner required#

String

A nested object, containing two sub-arrays. imageUrls and videoUrls. Each sub-array contains a list of urls of each subject for that unit-card.


publicKey required#

String

The owner of the unit card. Must be in the format of provider|id. For example, globalid|123abc


Sample Code#

Payload example#

{
"redemptionCode": "276c72d6-9de5-4b35-bed1-4b9e6f0ff159",
"owner": "roly|5fbfaa8e1f68b121686fa7c5",
"publicKey": "7b1dDYEL5pd5mSiJG3zW1bwZpY4qJKSwDqKADUoiM6ui"
}
url = "https://api.olyn.com/v1/unit-cards/_actions/redeem"
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Returns#

Returns a Unit Card object.

note

Returns an array of Unit Card objects if redemption code is obtained using batch action.