This documentation provides information about the Graviton Cloud RESTful Object Database HTTP API endpoints.
/api/v1/objectRetrieve an object based on the specified path.
x-api-key: Your API key (UUID format).path (query string, required): The path to the desired object. Example: /path/to/objectReturns the object at the specified path.
{
"status": "success",
"data": {
// ... object data
}
}
path parameter.{
"status": "error",
"message": "Missing or invalid path parameter."
}
{
"status": "error",
"message": "Unauthorized. Please provide a valid API key."
}
{
"status": "error",
"message": "Object not found."
}
curl -X GET "https://api.gravitoncloud.com/api/v1/object?path=/path/to/object" \
-H "x-api-key: your-uuid-formatted-api-key"
First, ensure you have axios installed:
npm install axios
Then, use the following script:
const axios = require('axios');
// Define the base URL and endpoint
const BASE_URL = 'https://api.gravitoncloud.com';
const ENDPOINT = '/api/v1/object';
// Define your query parameter and API key
const path = '/path/to/object';
const API_KEY = 'your-uuid-formatted-api-key'; // Replace with your actual API key
// Make the GET request
axios.get(`${BASE_URL}${ENDPOINT}`, {
params: {
path: path
},
headers: {
'x-api-key': API_KEY
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
x-api-key is in a valid UUID format./api/v1/objectUpdate or create an object at the specified path.
x-api-key: Your API key (UUID format).path (query string, required): The path to the object you want to update or create. Example: /path/to/objectIf the object is updated:
{
"status": "success",
"message": "Object updated successfully."
}
If a new object is created:
{
"status": "success",
"message": "Object created successfully."
}
path parameter or invalid JSON payload.{
"status": "error",
"message": "Missing or invalid data."
}
{
"status": "error",
"message": "Unauthorized. Please provide a valid API key."
}
curl -X PUT "https://api.gravitoncloud.com/api/v1/object?path=/path/to/object" \
-H "x-api-key: your-uuid-formatted-api-key" \
-H "Content-Type: application/json" \
-d '{
"field1": "value1",
"field2": "value2"
// ... other fields ...
}'
Ensure you have axios installed:
npm install axios
Then, use the following script:
const axios = require('axios');
// Define the base URL, endpoint, query parameter, API key, and payload
const BASE_URL = 'https://api.gravitoncloud.com';
const ENDPOINT = '/api/v1/object';
const path = '/path/to/object';
const API_KEY = 'your-uuid-formatted-api-key'; // Replace with your actual API key
const payload = {
field1: 'value1',
field2: 'value2'
// ... other fields ...
};
// Make the PUT request
axios.put(`${BASE_URL}${ENDPOINT}`, payload, {
params: {
path: path
},
headers: {
'x-api-key': API_KEY
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
x-api-key is in a valid UUID format./api/v1/objectCreate a new object at the specified path. If an object already exists at the specified path, the request will fail.
x-api-key: Your API key (UUID format).path (query string, required): The path for the new object. Example: /path/to/objectThe object was successfully created.
{
"status": "success",
"message": "Object created successfully."
}
path parameter or invalid JSON payload.{
"status": "error",
"message": "Missing or invalid data."
}
{
"status": "error",
"message": "Unauthorized. Please provide a valid API key."
}
{
"status": "error",
"message": "Conflict. Object already exists at the specified path."
}
curl -X POST "https://api.gravitoncloud.com/api/v1/object?path=/path/to/object" \
-H "x-api-key: your-uuid-formatted-api-key" \
-H "Content-Type: application/json" \
-d '{
"field1": "value1",
"field2": "value2"
// ... other fields ...
}'
Ensure you have axios installed:
npm install axios
Then, use the following script:
const axios = require('axios');
// Define the base URL, endpoint, query parameter, API key, and payload
const BASE_URL = 'https://api.gravitoncloud.com';
const ENDPOINT = '/api/v1/object';
const path = '/path/to/object';
const API_KEY = 'your-uuid-formatted-api-key'; // Replace with your actual API key
const payload = {
field1: 'value1',
field2: 'value2'
// ... other fields ...
};
// Make the POST request
axios.post(`${BASE_URL}${ENDPOINT}`, payload, {
params: {
path: path
},
headers: {
'x-api-key': API_KEY
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
/api/v1/objectDelete an object at the specified path.
x-api-key: Your API key (UUID format).path (query string, required): The path of the object to be deleted. Example: /path/to/objectThe object was successfully deleted.
{
"status": "success",
"message": "Object deleted successfully."
}
path parameter.{
"status": "error",
"message": "Missing or invalid path."
}
{
"status": "error",
"message": "Unauthorized. Please provide a valid API key."
}
{
"status": "error",
"message": "Object not found."
}
curl -X DELETE "https://api.gravitoncloud.com/api/v1/object?path=/path/to/object" \
-H "x-api-key: your-uuid-formatted-api-key"
Ensure you have axios installed:
npm install axios
Then, use the following script:
const axios = require('axios');
// Define the base URL, endpoint, and query parameter
const BASE_URL = 'https://api.gravitoncloud.com';
const ENDPOINT = '/api/v1/object';
const path = '/path/to/object';
const API_KEY = 'your-uuid-formatted-api-key'; // Replace with your actual API key
// Make the DELETE request
axios.delete(`${BASE_URL}${ENDPOINT}`, {
params: {
path: path
},
headers: {
'x-api-key': API_KEY
}
})
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.response ? error.response.data : error.message);
});
x-api-key is in a valid UUID format.