This document describes the API that returns the details associated with an MPSR item verifying if it's in use as collateral. Example of serial no include vehicle chassis number

Base URL

https://identity.cladfy.app/api/v1

API Endpoint:

POST /collateral

Request Headers:

  • Payload: The data sent to the server in the request body. Here, it's a JSON object with a single key-value pair:
    "serialno": 0 – A placeholder value that should be replaced with an actual serial number such as that includes vehicle chassis number.

  • Content-Type: "application/json" Indicates that the data in the request body is in JSON format.

  • Accept: "application/json"Tells the server that the client expects the response to be in JSON format.

  • Authorization: "Basic 123"
    Used for HTTP Basic Authentication, where "123" is a placeholder for the base64-encoded username:password credentials. See guide here

Request Body:

The request body contains the driver's license. It should be JSON with the properties below.

  • serialno: A serial number that includes the vehicle chassis number. - string.

Example Request Body:

{
  "serialno": "string"
}

Response - 200:

The response will be a JSON object following the request data type specification: A typed dictionary containing the detailed results. Properties include:


  • success

    • Type: boolean
    • Required: Yes
  • response_code

    • Type: integer
    • Required: Yes
    • Example: 200
  • message

    • Type: string
    • Required: Yes
    • Example: Collateral Check Fetched Successfully
  • data

    • Type: array[string]
    • Required: Yes
    • Constraints: >= 0 items and <= 0 items
  • request_id

    • Type: string
    • Required: Yes
    • Example: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Example Response:

{
  "success": true,
  "response_code": 200,
  "message": "Collateral Check Fetched Successfully",
  "data": [],
  "request_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

Error Handling:

401 Unauthorized: If the API key is invalid.
400 Bad Request: If the request body is not valid JSON or missing required fields.
500 Internal Server Error: If an internal server error occurs during API request processing. The response will include an error message.

Python Test Example:

This test example demonstrates sending a POST request to the API endpoint with the Serial Number. The response will include the associated details.

import requests

url = "https://identity.cladfy.app/api/v1/collateral"

payload = { "serialno": "string" }
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Basic 123"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())