Making Requests

Call Amboss GraphQL APIs from cURL, Node.js, and Postman with copy-paste examples for authenticated queries and mutations.

Examples for calling Amboss GraphQL APIs using common tools and languages.

Unauthenticated request:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"query":"query{getHello}"}' \
  https://api.amboss.space/graphql

Authenticated request:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer [API_KEY]" \
  -d '{"query":"query{getHello}"}' \
  https://api.amboss.space/graphql
const options = {
  method: "POST",
  url: "https://api.amboss.space/graphql",
  headers: {
    Authorization: "Bearer [API_KEY]",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "query Query { getHello }",
    variables: {},
  }),
};

request(options, (error, response) => {
  if (error) {
    console.log(error);
  } else {
    const json = JSON.parse(response.body);
    console.log(json);
  }
});

Set the request method

Change request type to POST.

Set the URL

Use https://api.amboss.space/graphql.

Configure the body

Change body type to GraphQL and add your query as the body.

Add authentication (optional)

For authenticated requests, add a header: Authorization: Bearer [API_KEY].

Send

Send the request.

API Endpoints

Replace the URL in the examples above with the endpoint for the product you're using. Rails / Payments uses x-api-key instead of Authorization: Bearer — see Authentication for the full per-product header table.

ProductGraphQL EndpointAuth HeaderApollo Studio Explorer
Spacehttps://api.amboss.space/graphqlAuthorization: BearerOpen Explorer
Reflexhttps://reflex.amboss.tech/graphqlAuthorization: BearerOpen Explorer
Magmahttps://magma.amboss.tech/graphqlAuthorization: BearerOpen Explorer
Railshttps://rails.amboss.tech/graphqlx-api-keyOpen Explorer