POST v3/redemptions - Redeem Code

Redeem an already created code for a specific user for access via the user's Bookshelf account.

Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols API Key, Access Token
Valid for Roles System to System

API Request

HTTP Verbs and URLs

POST v3/redemptions.xml

Request Headers

X-VitalSource-API-Key: ABCDEFGHIJKLMNOP
X-VitalSource-Access-Token: as787s7sd86s7ssrefg

Request Body

Request

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<redemption>
 	 <code>KJSHDFJHSDFJSKDDJFH</code>
</redemption>

Element Descriptions

Element Description Required
 Code The code already created via the Create Code request. Used for the redemption of a title for access by a user  Yes

Request Response

Success

HTTP Code: 200
<?xml version="1.0" encoding="UTF-8"?>
<library>
	<item author="Charles Dickens" href="vbk:L-999-70461" title="A Christmas Carol">
	</item>
</library>

Element Descriptions

Element Value Description
 item author  Author of redeemed code/title
  href  Link to the vbid/sku, to be used when forming the single sign-on request/redirect
  title  Title of redeemed code

Failure

See full list of error codes and messages.

HTTP Code: 200
<?xml version="1.0" encoding="UTF-8"?>
<error-response>
  	<error-code>469</error-code>
  	<error-text>Code has been redeemed</error-text>
</error-response>

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.