API Documentation
Welcome to the Reflex API!
Background
The Reflex API is a GraphQL endpoint that provides different queries and mutations to use Reflex.
Accessing the API
Our API is available at https://reflex.amboss.tech/graphql (opens in a new tab)
How to authenticate
All queries and mutations need authentication on this API.
You can get an API key by logging into amboss.space and going to your account panel. In the API Keys section you can create a new key.
The request should include the following header:
Authorization: Bearer [API KEY]
Making Requests
cURL
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer [API KEY]" -d '{"query":"query{getHello}"}' https://reflex.amboss.tech/graphql
Postman
To make a request from Postman you can follow these steps:
- Change request type to POST
- Change url to https://reflex.amboss.tech/graphql (opens in a new tab)
- Change body type to GraphQL
- Add the authorization header
- Add your query as the Body
- Send the request
NodeJS Example
let options = {
'method': 'POST',
'url': 'https://reflex.amboss.tech/graphql',
'headers': {
'Authorization': 'Bearer [Amboss api key here]’,
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query Query {getHello}'
variables: VARIABLES_OBJECT
})
};
request(options, (error, response) => {
if (error) {
console.log(error)
}
else {
let json = JSON.parse(response.body);
console.log(json)
}
});
Aggregated Queries
Some queries will perform aggregation of the data based on dates such as the getInvoices.find_many.aggregated
query. In these cases an aggregation_interval
field will be returned with the type of buckets used, for example MONTH
. If you would like the data to be aggregated using your local timezone instead of UTC time you can pass an additional cookie header along with the request as follows:
Cookie: amboss-reflex-api-timezone=America/New_York;
Note: If sending the cookie from the browser you will need to add the attribute samesite=none;
so that it will be sent along with cross-site requests.
If you are using JavaScript, your local timezone can be printed by calling the following method:
Intl.DateTimeFormat().resolvedOptions().timeZone;
More information on the timezone standard can be found here: IANA Time Zone Database (opens in a new tab).
Getting help with this graph
For support working with the API, contact us through Telegram (opens in a new tab) or Twitter (opens in a new tab).