Introduction
Welcome to Dividia ScaleWatcher API documentation! This API allows you to seamlessly search and retrieve information from the ScaleWatcher platform. With powerful search capabilities, you can quickly access data related to transactions, events, alerts and more.
Whether you’re integrating ScaleWatcher’s features into your application or building custom workflows, this API provides a simple, programmatic way to access the platform’s rich data.
Key Features:
- Advanced Search: Perform detailed and refined searches across various data types.
- Flexible Filtering: Narrow down your results with custom filters based on your requirements.
- Real-Time Access: Get up-to-date data directly from the ScaleWatcher platform for seamless integration.
This documentation will guide you through the authentication process, available endpoints, and response formats so you can easily interact with the API and leverage the full potential of the ScaleWatcher platform.
Authentication
Overview
To use Dividia’s ScaleWatcher API, you must authenticate using an API token and a site serial number. The API token verifies your identity, and the site serial number ensures you have access to the specific site’s data.
Prerequisite
Ensure that the site you wish to access has availed of an API Plan. If not, please contact support to discuss about our API Plan offerings.
Steps to Authenticate:
- Obtain an API Token:
If you don’t already have an API token, contact support to create an account and request API access. You will receive your unique token along with the list of sites (and their serial numbers) you were given access to via email after your request is processed.
* if you are a site admin, you may regenerate a new token within ScaleWatcher Cloud interface, if not, please contact your site’s admin to request for a new token - Include the Token and Serial in API Requests:
Add the API token in the Authorization header as a Bearer token and the site serial number as a query parameter in the request URL.
import axios from 'axios';
const url = 'https://api.cloud.dividia.net/sw/api/endpoint';
const serial = 'SITE_SERIAL_NUMBER';
const token = 'YOUR_API_TOKEN';
axios.get(`${url}?serial=${serial}`, {
headers: {
'Authorization': `Bearer ${token}`
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error.response.status);
})
Rate Limits
To ensure optimal performance and fair usage of the API, we impose the following rate limits:
If you exceed any of these limits, you will receive an error message indicating the rate limit has been exceeded, and you will need to wait until the window resets before making further requests.
Error Types
In the event of an error occurring during an API request, an error object will be returned. This object contains the following key fields:
- code: A numerical code representing the type of error that occurred.
- type: A brief identifier or label for the error, which helps categorize the issue.
- message: A human-readable description of the error, which provides helpful information or a tip to assist in troubleshooting the cause of the issue.
Common Parameters and Responses
Parameters
Response
Endpoints
/sw/api/alerts
Description: Search for ScaleWatcher transaction alerts
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/alerts?serial=6000&transactionId=2936037&includeActivities=1'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"page": 1,
"pagesize": 50000,
"total": 1,
"count": 1,
"data": [
{
"id": 468043,
"sName": "AlertValveDataFail",
"bTransaction": 2936037,
"sStatus": "inprogress",
"fFlagged": 0,
"bSerial": 6000,
"bAssignedId": 0,
"sAssignedUser": null,
"sData": {
"input": 1
},
"sImages": [
"https://api.cloud.dividia.net/uploads/scalewatcher/api/6000/2024/09/06/ValveDataFail_2024-09-06T19-08-54Z_1.jpg"
],
"dTimestamp": "2024-09-06T14:08:54.000Z",
"sPriority": "Medium",
"tzOffset": -5,
"bScale": 13,
"activities": [
{
"id": 120538,
"bAlertId": 468043,
"bUserId": 1,
"sUser": "Admin Dividia",
"dTimestamp": "2024-09-18T13:04:40.000Z",
"sComment": "",
"sAction": "status changed to: assigned"
}
]
}
]
}
/sw/api/events
Description: Search for ScaleWatcher transaction events
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/events?serial=6000&transactionId=2936037'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"page": 1,
"pagesize": 50000,
"total": 1,
"count": 1,
"data": [
{
"id": 6893440,
"sName": "AlertValveDataFail",
"bTransaction": 2936037,
"bTicket": null,
"bSerial": 6000,
"sData": {
"input": 1
},
"sImages": [
"https://api.cloud.dividia.net/uploads/scalewatcher/api/6000/2024/09/06/ValveDataFail_2024-09-06T19-08-54Z_1.jpg"
],
"dTimestamp": "2024-09-06T14:08:54.000Z",
"tzOffset": -5
}
]
}
/sw/api/events/tickets
Description: Search for ScaleWatcher transaction events based on ticket details
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/events/tickets?serial=6000&ticket=1000&customer=Command Alkon'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"page": 1,
"pagesize": 50000,
"total": 1,
"count": 1,
"data": [
{
"id": 6893535,
"bTransaction": 2936054,
"bTicket": "1000",
"bSerial": 6000,
"tzOffset": -6,
"sData": {
"ticket": {
"customer": "Customer: Command Alkon",
"status": "Z",
"weight": "76000 LB",
"autoid": "ABC1234",
"carrier": "Carrier: Dividia Tech.",
"locationid": "Location: 4400",
"uniqueid": "1588693466",
"time": "15:44:26",
"date": "02/02/2024",
"truck": "1234",
"ticket": "1000"
},
"number": "1000"
},
"sImages": [],
"dTimestamp": "2024-02-02T07:41:50.000Z"
}
]
}
/sw/api/transactions
Description: Search for ScaleWatcher transactions
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/transactions?serial=6000&id=2936037&includeEvents=1&includeAlerts=1'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"page": 1,
"pagesize": 50000,
"total": 1,
"count": 1,
"data": [
{
"id": 2936037,
"bSerial": 6000,
"bScale": 13,
"dTimestamp": "2024-09-06T14:08:54.000Z",
"dStart": "2024-09-06T14:08:54.000Z",
"dEnd": "2024-09-06T14:08:54.000Z",
"tzOffset": -5,
"sLpn": "",
"sTruck": null,
"bTicket": null,
"bFacilityDuration": 0,
"bLoadDuration": 0,
"bWaitDuration": 0,
"fHidden": 0,
"sTag": "",
"events": [],
"alerts": []
}
]
}
/sw/api/transactions/stats
Description: Get average, min and max statistics for the searched ScaleWatcher transactions
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/transactions/stats?serial=6000&startDate=2024-06-03&endDate=2024-06-04&interval=daily'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"data": [
{
"bCount": 15,
"bFacilityMin": 921,
"bFacilityMax": 2428,
"bFacilityAvg": 1696,
"bLoadMin": 0,
"bLoadMax": 1571,
"bLoadAvg": 514,
"bWaitMin": 0,
"bWaitMax": 1840,
"bWaitAvg": 632,
"dDate": "2024-06-03"
},
{
"bCount": 27,
"bFacilityMin": 832,
"bFacilityMax": 5705,
"bFacilityAvg": 1642,
"bLoadMin": 0,
"bLoadMax": 1593,
"bLoadAvg": 417,
"bWaitMin": 0,
"bWaitMax": 2684,
"bWaitAvg": 475,
"dDate": "2024-06-04"
}
]
}
/sw/api/users
Description: Search for ScaleWatcher users
Parameters
const url = 'https://api.cloud.dividia.net/sw/api/users?serial=6000&id=102'
axios.get(url, { headers: {'Authorization': `Bearer ${YOUR_API_TOKEN}`} }).then(response => { console.log(response.data })
Return
{
"page": 1,
"pagesize": 50000,
"total": 1,
"count": 1,
"data": [
{
"id": 102,
"sEmail": "test@dividia.test",
"sName": "API Test User",
"createdAt": "2025-02-24T14:51:00.000Z",
"hasAdminRights": 0,
"hasApiRights": 1,
"dLastActive": "2025-03-07T02:43:58.000Z"
}
]
}
Terms of Use
By using Dividia’s API, you agree to the following terms of use:
Permitted Use:
You may only use the API to access and integrate data from Dividia’s services for your own legitimate business purposes, in accordance with our documentation and applicable laws.
Authentication:
You must use valid API credentials to access the API, and are responsible for maintaining the security of your credentials.
Rate Limits:
You must adhere to our established API rate limits to prevent excessive usage and ensure fair access for all users. Exceeding these limits may result in temporary or permanent suspension of access.
Data Privacy:
You must handle any data obtained through the API with the utmost care, complying with all relevant privacy laws and regulations when processing user information.
Prohibited Uses:
You may not use the API for any illegal or malicious purposes, including scraping, spamming, or unauthorized access to data.
Service Availability:
We strive to maintain API uptime, but we do not guarantee uninterrupted service. Scheduled maintenance or unexpected downtime may occur.
Modification and Termination:
Dividia reserves the right to modify or terminate API access at any time, without prior notice, for any reason, including violation of these terms.
Indemnification:
You agree to indemnify and hold Dividia harmless from any claims arising from your use of the API.
Governing Law:
These terms are governed by and construed in accordance with the laws of the State of Texas, United States of America. Any disputes arising from these terms shall be resolved in the courts located in Fort Worth, Texas.
By accessing and using the API, you acknowledge that you have read and agree to these terms of use.
