Skip to content

Update Card API V2

POST https://secure-{REGION}.id123.io/api/v2/ action: update-card

New to the API?

Start with the API V2 Introduction for authentication, terminology (IDMS, Card Template, API Key), and a full endpoint list.

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.

Requests Format

POST /api/v2/ HTTP/1.1
Host: secure-{REGION}.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" ,
   "access-control":{
           "acs-identifier":"ACCESS_CONTROL_SYSTEM_USER_IDENTIFIER", // Unique Identifier under ACS
           "acs-groups":"ACCESS_CONTROL_SYSTEM_PERMISSION_GROUPS" // comma-separated list of access groups
   },
   "card-data": {
    "barcode": [
      {
        "key": "barcode",
        "value": "VALUE"
      }
    ],
    "image": [
      // An image can be passed as a photo URL.
      {
        "key": "id-photo",
        "value": "PHOTO URL"
      },
      // Alternatively, an image can be passed as base64 encoded data.
      {
        "key": "id-photo",
        "value": "BASE64_IMAGE_DATA", // Sample : data:image/png;base64,iVBORw0KGgoAAAA.....JRU5ErkJggg==
        "type": "base64-encoded-image"
      }
    ],
    "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": "S2002",
   "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"
}