To interact with the Epycbyte REST API effectively, follow these organized steps:
-
Obtain an Access Token:
- Use OAuth 2.0 to exchange an OAuth code for an Access Token.
- Send a POST request to
/v1/authenticatewith your OAuth code in the request body. - Include appropriate headers like
Content-Type: application/jsonandAccept: application/json.
-
Explore API Endpoints:
- Use the obtained Access Token as a Bearer token in subsequent requests by adding the header
Authorization: Bearer {token}.
- Use the obtained Access Token as a Bearer token in subsequent requests by adding the header
-
Manage Projects:
- Create a Project: Send a POST request to
/v9/projectswith an empty body. - Retrieve Project Details: Use GET on
/v9/projects/{idOrName}where{idOrName}is the project's ID or name obtained from the creation response.
- Create a Project: Send a POST request to
-
Manage Domains:
- List Domains: Use GET on
/v5/domains. - Domain Configuration: Access specific domain details using endpoints like
/v6/domains/{domain}/config.
- List Domains: Use GET on
-
Handle Environmental Variables:
- Create Project-Specific Variables: POST to
/v9/projects/{idOrName}/envwith a JSON object containing the variable name and value. - Manage Global Variables: Use endpoints under
/v9/projects/envfor account-wide management.
- Create Project-Specific Variables: POST to
-
Interact with Teams:
- Team Details: GET on
/v2/teams/{teamId}to retrieve team information. - Team Members: Access members via
/v2/teams/{teamId}/members.
- Team Details: GET on
-
Log Drain Management:
- Create Log Drains: POST to
/v1/integrations/log-drainswith configuration details. - List and Delete Log Drains: Use GET and DELETE requests on the respective endpoints.
- Create Log Drains: POST to
-
Scope Management:
- Ensure your Access Token has the necessary scopes for each API action.
- For scope changes, follow the confirmation process outlined in Epycbyte's documentation to apply updates after user consent.
-
Error Handling:
- Address CORS by handling it on your server-side.
- Check for 403 errors and ensure required parameters like
teamIdare included in requests.
-
Testing with Tools:
- Use tools like curl to test endpoints and understand response structures.
- Be mindful of pagination when fetching large lists of data.