Update Card API V2 Introduction
This API is used to update card information. You need to provide update data as a key-value pair to update a card’s information. Expired cards can also be renewed using this API. Here, api-key, card-template-id and card-id are used to identify the card data to update. You can only update one card at a time. You are only required to pass the card-data key value pairs being updated. Passing a key value pair with an empty value will update the value to empty. Card status cannot be updated using this API. If you attempt to update a record that does not exist, an error will be thrown unless ‘upsert-record’ is set to true. If upsert record is set to true then a new card record will be added if the card-id does not exist.
Request Format
POST /api/v2/ HTTP/1.1
Host: secure.id123.io
X-API-KEY: API_KEY
Content-Type: application/json
Content-Length: 952
{
"action": "update-card",
"upsert-record" : true/false // optional
"card-template-id": "CARD_TEMPLATE_ID",
"card-id": "CARD_ID",
"unique-identifier": "UNIQUE IDENTIFIER",
"security-question-1": "SECURITY QUESTION 1",
"security-question-2": "SECURITY QUESTION 2",
"card-expiration": "2020-07-16T23:50:30.045+05:30",
"recipient-email": "RECIPIENT EMAIL" ,
"card-data": {
"barcode": [
{
"key": "barcode",
"value": "VALUE"
}
],
"image": [
{
"key": "id-photo",
"value": "PHOTO URL"
}
],
"name-fields": [
{
"key": "name",
"value": "NAME"
}
],
"front-fields": [
{
"key": "front-1",
"value": "VALUE"
},
{
"key": "front-2",
"value": "VALUE"
}
],
"secondary-fields": [
{
"key": "secondary-1",
"value": "VALUE"
},
{
"key": "secondary-2",
"value": "VALUE"
}
],
"back-fields": [
{
"key": "back-1",
"value": "VALUE"
},
{
"key": "back-2",
"value": "VALUE"
}
]
}
Success Response
{
"status": "success",
"code": "SUCCESS CODE",
"message": "SUCCESS MESSAGE.",
"card-id": CARD_ID,
"card-template-id": "CARD_TEMPLATE_ID"
}
Failure Response
{
"status": "failure",
"code": "ERROR CODE",
"message": "ERROR MESSAGE.",
"card-id": "CARD_ID",
"card-template-id": "CARD_TEMPLATE_ID"
}
.
.
.