Data API

Create a record

To create a record, use the below API. It accepts a JSON Payload as shown in the below.

For any linked parent example:

JSON

{

"name" : "FedEx Transport Services",

"parent" : {

    "id" : 1011

}

}

Example Data API:

POST   /data/<DataObject>/create

Update a record

To update a record, use the below API. It accepts a JSON Payload as shown in the below example. Make sure to include ID as url variable.

JSON

{

"id" : "101189",

"name" : "FedEx Transport Services"

}

Example Data API:

POST   /data/<DataObject>/update/<id>

Create multiple records

To create multiple records, use the below API. It accepts a JSON Payload as shown in the below.

For any linked parent example:

JSON

[

{

"name" : "FedEx Transport Services",

"parent" : {

    "id" : 1011

}

]

Example Data API:

POST   /data/<DataObject>/create_multiple

Create or Update multiple records

To create or update multiple records, use the below API. It accepts a JSON Payload as shown in the below.

For any linked parent example:

JSON

[

{

"name" : "FedEx Transport Services",

"parent" : {

    "id" : 1011

    }

}

]

Example Data API:

POST   /data/<DataObject>/upsert_multiple

Fetch records

To fetch records

JSON

{

"fields" : "Name;Type;Parent.Id" ,

"conditions" : ["Parent.Id = 1011001”, “Type = ‘Normal’"] ,

"logic" : "({0} AND {1}) OR {2}"

}

Example Data API:

POST   /data/<DataObject>/list

Delete a record

Example Data API:

POST   /data/<DataObject>/delete?id=xx

Delete Multiple records

Example Data API:

POST   /data/<DataObject>/delete_multiple

Document API

Delete an Uploaded File

To delete an uploaded file. Make sure to include id as a url parameter.

POST   /document/upload/delete?id=xx

Upload a File

To upload a file. Include type, referenceNumber and additionalInfo as url parameters.

POST   /document/upload/<type>?referenceNumber=xx&additionalInfo=xx

Get a File

To get a file. Include type, referenceNumber and additionalInfo as url parameters.

GET   /document/upload/documents?referenceNumber=x&type=<type>&additionalInfo=x

Dashboard and Components

Styles

The root styles, card css and the widget css are to be kept as it is to maintain a uniform layout/UI throughout all the dashboards.

HTML

<style>

  :root {

    --primary-color: #4f46e5;

    --primary-light: #eef2ff;

    --secondary-color: #10b981;

    --text-primary: #1e293b;

    --text-secondary: #64748b;

    --bg-color: #f8fafc;

    --card-bg: #ffffff;

    --card-border: #e2e8f0;

    --danger-color: #ef4444;

    --warning-color: #f59e0b;

    --success-color: #10b981;

    --info-color: #0ea5e9;

    --radius-sm: 6px;

    --radius-md: 10px;

    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.05);

    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);

    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  }

  .card {

    margin-top: 30px;

    background-color: var(--card-bg);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition: all 0.2s ease;

    border: 1px solid var(--card-border);

  }

  .card:hover {

    box-shadow: var(--shadow-md);

  }

  .widget-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 0.75rem 1rem;

    border-bottom: 1px solid #f0f0f0;

    margin-bottom: 10px;

  }

  .widget-header h5 {

    font-size: 1.5rem;

    font-weight: 600;

    margin: 0;

    color: var(--text-primary);

  }

  .widget-header i {

    margin-right: 10px;

  }

  .widget-content {

    padding: 1rem;

  }

</style>

<body>

  <div class="yourcomponentname-widget card" data-widget-type="yourcomponentname">

    <div class="widget-header">

      <h5><span><i class="fa-solid fa-chart-column" style="color: #1b649d;"></i></span>Chart</h5>

    </div>

    <div style="height: 210px; position: relative;">

      <canvas id="giveIDToYourcanvas"></canvas>

    </div>

  </div>

<script> /* Start your script for your component */ </script>

</body>

Fetch Components

To fetch available components for the dashboard.

Fetch Available Components API:

GET   /app/dashboard_components

Save Components

To save the components for that particular dashboard page.

Example of accepted Payload (Sample Request Body Output):

JSON

{

"name" : "chart",

"section" : "1",

"sequence" : "1",

}

Where “name” corresponds to the components name, “section” is the section in which it has been saved (for ex: Header Section, Left Section, Right Section) and the “sequence” is the sequence in which it has been saved.

Save the Layout API:

POST   /dashboard/save_page?name=x

Render Components

To render the components on drop without needing to save the layout or refresh.

Render Components API:

This API helps you fetch the files of the components (Mainly the HTML file and the JavaScript file). This enables the user to have an idea of what the component is gonna look like actually.

GET   /app/dashboard_component_body?name=x