It is possible to expose our GraphQL API to integrations that only handle REST by moving everything into the query parameters of the URL. The documentation here is made public to Factbird customers.
You will talk to the Factbird API, much like Power BI and Excel does in Power Query, and make various API calls depending on what data you are interested in. In the following we will outline what our API expects and the various queries you can perform.
The following outlines the connection details to the Factbird API:
https://api.cloud.factbird.com
Accept: application/json;
Content-Type: application/json
Authorization: xxxxx-xxxxx-xxxxxxx-xxxxx
GET
Our API is deployed globally and we cannot provide a static set of IP addresses. The best alternative is to list a number of possible subnets: http://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips - for a more detailed list, refer to https://ip-ranges.amazonaws.com/ip-ranges.json , the service of interest is the one listed as CLOUDFRONT. These two links contain the most up-to-date address scopes. Which subnet you need to whitelist depends on where you make the request from. The region codes correspond to the geographical areas listed here: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints
The Authorization token is provided by sending a request to [email protected].
From this we can start making queries for specific data. We'll do this by extending the URL from above to contain the specific data we want along with the parameters for this data (from, to, which line, etc).
These queries will look a bit long, but that's because we are essentially converting a GraphQL request (which our API is set up as) to a REST compatible request by putting the request into the GET parameter of the URL along with URL encoding it.
To replicate how we present something in the application, you can check the network request in the browser Developer Tools, i.e.:
The following table gives an overview of the query
and variables
pieces that are needed to form the final query: