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/graphqlAuthenticated request:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [API_KEY]" \
-d '{"query":"query{getHello}"}' \
https://api.amboss.space/graphqlconst 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.
| Product | GraphQL Endpoint | Auth Header | Apollo Studio Explorer |
|---|---|---|---|
| Space | https://api.amboss.space/graphql | Authorization: Bearer | Open Explorer |
| Reflex | https://reflex.amboss.tech/graphql | Authorization: Bearer | Open Explorer |
| Magma | https://magma.amboss.tech/graphql | Authorization: Bearer | Open Explorer |
| Rails | https://rails.amboss.tech/graphql | x-api-key | Open Explorer |