Sending API requests

The GraphQL API is served over HTTP. Requests must be sent to https://app.cyanite.ai/graphql via the POST method.

Are you new to GraphQL in general? GraphQL is a query language that is used for reading data from our service. You can learn the basics on Try GraphQL. Our GraphQL API allows you to request the data you need.

You can play around with the API by visiting our GraphQL Playground in your browser.

For authentication the Authorization header must be set. It uses the Bearer format e.g. Authorization: Bearer xxxxxxxxx121.

Example JSON Content-Body:

{
"query": "query inDepthAnalyses($first: Int!) { inDepthAnalyses(first: $first) { edges { node { id title status } } }",
"operationName": "operationName",
"variables": {
"first": 10
}
}

Example Curl Call

curl \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer xxxxxx1212"\
--data '{ "query": "query inDepthAnalyses($first: Int!) { inDepthAnalyses(first: $first) { edges { node { id title status } } }", variables: { "first": 10 } }' \
https://app.cyanite.ai/graphql

Example Javascript Fetch Call

fetch("https://app.cyanite.ai/graphql", {
method: "POST",
body: JSON.stringify({
query: {
query: /* GraphQL */ `
query inDepthAnalyses($first: Int!) {
inDepthAnalyses(first: $first) {
edges {
node {
id
title
status
}
}
}
}
`,
variables: {
first: 10
}
}
}),
headers: {
"Content-Type": "application/json",
Authorization: "Bearer" + "xxxxxx1212"
}
})
.then(res => res.json())
.then(console.log);

Uploading Files

Check out the Integrating InDepthAnalysis Guide for uploading files.