Skip to main content

Cards

The Template Cards API allows you to manage the lifecycle of template cards, including creating, viewing, updating, and deleting them.

A template cards allows you to upload text data, as key and value format, to the DPP object.

Upload Template Cards

1. Create Template Card

POST /create-template-card/:templateId

Description: Create a new template card for a specific template.

Request Body

{
"name": "string",
"description": "string",
"characteristics": [
{
"name": "string",
"description": "string"
}
]
}

Response

StatusDescription
200 OKTemplate card created successfully along with its characteristics.
400 Bad RequestInvalid request body or characteristics are not iterable.
500 Internal Server ErrorAn error occurred while creating the Template card.

Response Object

{
"message": "Template card created successfully",
"ok": true,
"template_card": {
"id": "string",
"template_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"characteristics": [
{
"id": "string",
"template_card_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string"
}
]
}
}

2. View Template Cards

GET /view-template-cards/:templateId

Description: Retrieve all template cards for a specific template.

Response

StatusDescription
200 OKSuccessfully retrieved the list of Template cards with their characteristics.
500 Internal Server ErrorAn error occurred while fetching the Template cards data.

Response Object

{
"message": "Template cards retrieved successfully",
"ok": true,
"template_cards": [
{
"id": "string",
"template_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"characteristics": [
{
"id": "string",
"template_card_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string"
}
]
}
]
}

3. View Template Card

GET /view-template-card/:templateId/:cardId

Description: Retrieve the details of a specific template card.

Response

StatusDescription
200 OKSuccessfully retrieved the Template card with its characteristics.
406 Not AcceptableThe specified Template card was not found.
500 Internal Server ErrorAn error occurred while fetching the Template card data.

Response Object

{
"message": "Template card retrieved successfully",
"ok": true,
"template_card": {
"id": "string",
"template_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"characteristics": [
{
"id": "string",
"template_card_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string"
}
]
}
}

4. Update Template Card

PUT /update-template-card/:templateId/:cardId

Description: Modify the details of an existing template card.

Request Body

{
"name": "string",
"description": "string",
"characteristics": [
{
"id": "string",
"name": "string",
"description": "string"
}
]
}

Response

StatusDescription
200 OKTemplate card updated successfully with new characteristics.
400 Bad RequestInvalid request body or characteristics are not iterable.
406 Not AcceptableTemplate card not found with the specified ID.
500 Internal Server ErrorAn error occurred while updating the Template card.

Response Object

{
"message": "Template card updated successfully",
"ok": true,
"template_card": {
"id": "string",
"template_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"characteristics": [
{
"id": "string",
"template_card_id": "string",
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string"
}
]
}
}

5. Delete Template Card

DELETE /delete-template-card/:templateId/:cardId

Description: Delete an existing template card.

Response

StatusDescription
200 OKTemplate card and its characteristics deleted successfully.
500 Internal Server ErrorAn unexpected error occurred during the deletion process.

Response Object

{
"message": "Template card deleted successfully",
"ok": true
}

6. Delete Card Characteristic

DELETE /characteristic/:characteristicId

Description: Delete a single card characteristic.

Response

StatusDescription
200 OKCard characteristic deleted successfully.
500 Internal Server ErrorAn unexpected error occurred during the deletion process.

Response Object

{
"message": "Characteristic deleted successfully",
"ok": true
}