GraphQL API¶
Easy8 exposes a GraphQL API that its own front end uses. Use it if you build a front-end plugin. For server-to-server integrations, use the REST-like API. To extend the GraphQL schema in Ruby, see Backend_tutorials / features / graphql.
Endpoint¶
Send GraphQL queries and mutations as POST requests to /graphql, or to /projects/{project_id}/graphql to run them in the context of a project.
curl -X POST \
-H "X-Easy8-API-Key: <api-key>" \
-H "Content-Type: application/json" \
-d '{"query": "{ __typename }"}' \
"https://demo.easy8.com/graphql"
The body accepts query, variables and operationName. For an on-premises installation, use the URL or IP address of your server.
Authentication¶
Authenticate with your Easy8 API key, the same way as for the REST-like API: the X-Redmine-API-Key or X-Easy8-API-Key header, an Authorization: Bearer <api-key> header, or the key query parameter. You can find the API key in your account settings. The REST API must be enabled in the administration settings.
Schema browser¶
The schema browser (GraphiQL) lets you write queries, pass variables and browse the schema documentation: queries, mutations and subscriptions. It is mounted at /graphiql only when Easy8 runs in the development environment, so it is not available on cloud or production installations. To explore the schema there, use introspection queries against /graphql.
Rate limits¶
GraphQL requests are not throttled.
Status and error codes¶
400BAD REQUEST: an argument or thevariablesparameter is invalid401UNAUTHORIZED: the credentials are missing or incorrect403FORBIDDEN: you do not have access to the resource404NOT FOUND: the resource does not exist500INTERNAL SERVER ERROR: the query failed unexpectedly
Errors in the query itself, such as an unknown field, are returned in the errors array of a 200 response.