Check Connection

Updated on: October 9, 2025
Purpose: Check the real-time connection status of a specific Salpre Box device. This is useful before making outbound calls or diagnosing connection issues.


Endpoint

POST https://ai.salpre.com/api/gateway/v1/salprebox/check-device-connection

Authentication:
All requests require your Account Secret Key.

account-secret-key: YOUR_API_KEY

Content type:
multipart/form-data

Keep your Account Secret Key secure. Use server-side calls whenever possible.


Parameters

NameTypeRequiredDescription
device_embedded_idstringYesThe embedded serial number of the Salpre Box you want to check. Example: EXAMPLE_SERIAL_NO.

Code samples

cURL (Bash)

curl --location --request POST 'https://ai.salpre.com/api/gateway/v1/salprebox/check-device-connection' \
--header 'account-secret-key: YOUR_API_KEY' \
--form 'device_embedded_id="EXAMPLE_SERIAL_NO"'

JavaScript (Fetch)

const myHeaders = new Headers();
myHeaders.append("account-secret-key", "YOUR_API_KEY");

const formdata = new FormData();
formdata.append("device_embedded_id", "EXAMPLE_SERIAL_NO");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://ai.salpre.com/api/gateway/v1/salprebox/check-device-connection", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log("error", error));

Example response

{
    "is_connected": boolean (true|false)
}

Error responses

Missing or invalid authentication key

{
    "code": 401,
    "status": false,
    "message": "Authorization Error! Invalid Account Secret Key!"
}

Device not found

{
    "is_connected": false
}

Notes & best practices

  • Always check connection status before initiating calls.
  • A is_connected: true response confirms the device is online and ready.
  • Use this endpoint periodically to monitor real-time connectivity of multiple devices.
  • signal_strength is measured in dBm — values closer to 0 indicate better signal quality.
  • If the device shows offline, ensure it has power, stable Wi-Fi, and Bluetooth is enabled.

Next