Home ci 22. rest-api: epycbyte api integrations

22. rest-api: epycbyte api integrations

Last updated on Aug 05, 2025

To interact with the Epycbyte REST API effectively, follow these organized steps:

  1. Obtain an Access Token:

    • Use OAuth 2.0 to exchange an OAuth code for an Access Token.
    • Send a POST request to /v1/authenticate with your OAuth code in the request body.
    • Include appropriate headers like Content-Type: application/json and Accept: application/json.
  2. Explore API Endpoints:

    • Use the obtained Access Token as a Bearer token in subsequent requests by adding the header Authorization: Bearer {token}.
  3. Manage Projects:

    • Create a Project: Send a POST request to /v9/projects with 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.
  4. Manage Domains:

    • List Domains: Use GET on /v5/domains.
    • Domain Configuration: Access specific domain details using endpoints like /v6/domains/{domain}/config.
  5. Handle Environmental Variables:

    • Create Project-Specific Variables: POST to /v9/projects/{idOrName}/env with a JSON object containing the variable name and value.
    • Manage Global Variables: Use endpoints under /v9/projects/env for account-wide management.
  6. Interact with Teams:

    • Team Details: GET on /v2/teams/{teamId} to retrieve team information.
    • Team Members: Access members via /v2/teams/{teamId}/members.
  7. Log Drain Management:

    • Create Log Drains: POST to /v1/integrations/log-drains with configuration details.
    • List and Delete Log Drains: Use GET and DELETE requests on the respective endpoints.
  8. 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.
  9. Error Handling:

    • Address CORS by handling it on your server-side.
    • Check for 403 errors and ensure required parameters like teamId are included in requests.
  10. Testing with Tools:

    • Use tools like curl to test endpoints and understand response structures.
    • Be mindful of pagination when fetching large lists of data.