Get card art
Use this API call to get the graphical material of the card issued to the cardholder. The flow is as defined below.
Notice that the flow is split up into two steps.
The requester requests card art to a token given.
Later when the card art is generated Cardtokens sends an async notification including the card art payload.
Endpoint and method​
Method: GET
Endpoint: https://api.cardtokens.io/api/token/{tokenid}/cardart
Response parameters​
Parameter name | Data type | Description |
---|---|---|
url | String | The full URL to where the notification is transmitted by HTTP POST including card art details. |
tokencardartqueueid | String | The uniqueue reference to the enqueued request for card art. |
Example response​
{
"url": "https://YOUR-DOMAIN-FOR-CARDART-NOTIFICATIONS/{tokenid}",
"tokencardartqueueid": "5f6463cbdf4b423590d916aab22f8e44"
}
Notification parameters​
Coming soon. Contact us at hello@cardtokens.io for more info.
Endpoint and method​
Method: POST
Endpoint: https://YOUR-DOMAIN-FOR-CARDART-NOTIFICATIONS/{tokenid}
Parameter name | Data type | Description |
---|---|---|
b64image | String | A base 64 encoded value of the PNG. This can be inserted directly into an IMG tag or decoded and written to file. |
mimetype | String | The http protocol formatting type of the image. Currently only image/png is available. |
width | Integer | The width of the image. |
height | Integer | The height of the image. |
last4 | String | The last 4 digits of the PAN. |
expmonth | Integer | The expiry month of the token. N2 formatted as 12. |
expyear | Integer | The expiry year of the token. Formatted as N4 (e.g. 2099). |
issuer | String | The name of the bank which has issued the card. |
Example payload​
{
"b64image": "iVBORw0KGgoAA………………AAGUCAYA=",
"mimetype": "image/png",
"height": 404,
"width": 640,
"expmonth": 2,
"expyear": 2028,
"last4": "6486",
"issuer": "Bank of Cardtokens"
}
How to display the image​
The base64 encoded image can be displayed in HTML using this format:
<img src="”data:{mimetype};base64," {b64image}” />
From the example, this will look like this:
<img src=”data:image/png;base64, iVBORw0KGgoAA………………AAGUCAYA=” />