API Reference
Authentication
To access the CycoServe API, you need to include an authentication token in your requests. Here’s how to obtain it:
- Sign up for a CycoServe account.
- Generate an API token from your account settings.
- Add the token as a Bearer token in the Authorization header of your requests.
Example:
fetch('https://api.cycoserve.com/endpoint', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
}
})
Available Endpoints
1. Get User Information
Retrieve details about the authenticated user.
GET https://api.cycoserve.com/v1/user
Response:
{
"id": "123",
"name": "John Doe",
"email": "john.doe@example.com"
}
2. List Projects
Get a list of projects associated with the authenticated user.
GET https://api.cycoserve.com/v1/projects
Response:
[
{
"id": "1",
"name": "Project One",
"created_at": "2023-01-01T00:00:00Z"
},
{
"id": "2",
"name": "Project Two",
"created_at": "2023-02-01T00:00:00Z"
}
]
Error Handling
In case of an error, the API will return a response with an error code and message. Here’s how to handle errors:
fetch('https://api.cycoserve.com/endpoint')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => console.log(data))
.catch(error => console.error('There was a problem with the fetch operation:', error));
Contact Support
For any questions or issues related to the API, please reach out to our support team:
Email: support@cycoserve.com
Or visit our Community Forum for help from other developers.