REST API
Device Data
Purge Device Data

Purge Device Data

DELETE /v2/projects/{PROJECT_ID}/devices/{DEVICE_ID}/data

Delete the device data for the provided device ID.

Be aware that deleting device data is irreversible and can not be undone.

device_data.ts
import type { NextApiRequest, NextApiResponse } from 'next';
 
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<any>
) {
const projectId = "your_project_id";
const deviceId = "your_device_id";
const apiKey = "your_api_key";
 
const result = await fetch(`https://api.qubitro.com/v2/projects/${projectId}/devices/${deviceId}/data`, {
headers: {
  "Authorization": `Bearer ${apiKey}`
},
method: "DELETE"
});
 
if (result.ok) {
res.status(200).json({ message: 'Data deleted successfully.' });
} else {
const error = await result.json();
res.status(result.status).json(error);
}
}
 
Path Parameters
OptionTypeDescription
PROJECT_ID`String`The ID of the project.
DEVICE_ID`String`The ID of the device.
Response
{
  "success": "Boolean indicating the success of the request",
  "action": "Description of the action taken by the server",
  "status": "HTTP status code",
  "message": "Message from the server describing the result of the operation",
  "data": "Additional data related to the response (if applicable)"
}
Response codes
OptionTypeDescription
200OKThe request was successful.
400Bad RequestThe request could not be understood or was missing required parameters.
401UnauthorizedAuthentication failed or was not provided.
403ForbiddenAuthentication succeeded, but the authenticated user does not have access to the requested resource.
404Not FoundThe requested resource could not be found.
500Internal Server ErrorAn error occurred on the server.

logo

Start building today

Collect, process, and activate device data. Scale from one device to thousands.

Qubitro Logo

Product

Decision Aids

Resources

Company

© 2024 Qubitro, Inc. All rights reserved