REST API
Project
Fetch Projects

Fetch projects

GET /v2/projects

Get the list of the projects under the account corresponding to the API key.

project.ts
import { NextApiRequest, NextApiResponse } from 'next';
 
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<any>
) {
const apiKey = 'your_api_key';
 
const config: RequestInit = {
method: 'GET',
headers: {
  'Authorization': `Bearer ${apiKey}`
}
};
 
try {
const result = await fetch('https://api.qubitro.com/v2/projects', config);
const data = await result.json();
res.status(result.status).json(data);
} catch (error) {
res.status(500).json({ error: 'An error occurred while processing the request.' });
}
}
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": [
    {
      "id": "unique identifier of the project",
      "name": "name of the project",
      "description": "description of the project",
      "created_at": "timestamp indicating when the project was created"
    }
  ]
}
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