Eduflow
Search…
Usage

API Access

Headers
Authorization: Bearer <api_key>
Endpoint
https://app.eduflow.com/api/graphql
General requests to the API endpoint will return JSON.
The response will be wrapped in "data" and match the shape of the original query.
curl
wget
node
python
curl(1) example:
1
EDUFLOW_API_KEY=<api_key> \
2
curl \
3
-H 'Content-Type: application/json' \
4
-H "Authorization: Bearer ${EDUFLOW_API_KEY}" \
5
-X POST \
6
-d '{"query": "{institution {name}}"}' \
7
https://app.eduflow.com/api/graphql
Copied!
wget(1) example:
1
EDUFLOW_API_KEY=<api_key> \
2
wget -qO- \
3
--header 'Content-Type: application/json' \
4
--header "Authorization: Bearer ${EDUFLOW_API_KEY}" \
5
-X POST \
6
--post-data '{"query": "{institution {name}}"}' \
7
https://app.eduflow.com/api/graphql
Copied!
1
#!/bin/env node
2
3
if (!process.env.EDUFLOW_API_KEY) {
4
console.error(`Enter your EDUFLOW_API_KEY:
5
6
env EDUFLOW_API_KEY=<api_key> node index.js`);
7
return;
8
}
9
10
const http =
11
process.env.EDUFLOW_API_PROTOCOL === "http"
12
? require("http")
13
: require("https");
14
15
const query = JSON.stringify({
16
query: `{
17
institution {
18
name
19
}
20
}`,
21
});
22
23
const options = {
24
hostname: process.env.EDUFLOW_API_HOSTNAME || "app.eduflow.com",
25
path: "/api/graphql",
26
port: process.env.EDUFLOW_API_PORT || 443,
27
method: "POST",
28
headers: {
29
"Content-Type": "application/json",
30
"Content-Length": query.length,
31
Authorization: "Bearer " + process.env.EDUFLOW_API_KEY,
32
"User-Agent": "Node",
33
},
34
};
35
36
const req = http.request(options, (res) => {
37
let data = "";
38
res.on("data", (d) => {
39
data += d;
40
});
41
res.on("end", () => {
42
console.log(JSON.parse(data).data);
43
});
44
});
45
46
req.on("error", (error) => {
47
console.error(error);
48
});
49
50
req.write(query);
51
req.end();
Copied!
1
#!/bin/env python
2
import json
3
import os
4
import sys
5
import urllib.request
6
7
api_key = os.getenv("EDUFLOW_API_KEY")
8
if api_key is None:
9
sys.exit(
10
"""Enter your EDUFLOW_API_KEY:
11
12
env EDUFLOW_API_KEY=<api_key> python app.py"""
13
)
14
15
query = """{
16
institution {
17
name
18
}
19
}"""
20
21
raw_data = {
22
"query": query,
23
"variables": {},
24
}
25
data = json.dumps(raw_data).encode("utf-8")
26
27
options = {
28
"data": data,
29
"headers": {
30
"Content-Type": "application/json",
31
"Content-Length": len(data),
32
"Authorization": f"Bearer {api_key}",
33
"User-Agent": "Node",
34
},
35
}
36
37
hostname = os.getenv("EDUFLOW_API_HOSTNAME", "app.eduflow.com")
38
protocol = os.getenv("EDUFLOW_API_PROTOCOL", "https")
39
port = os.getenv("EDUFLOW_API_PORT", 443)
40
url = f"{protocol}://{hostname}:{port}/api/graphql"
41
42
request = urllib.request.Request(url, **options)
43
44
try:
45
response = urllib.request.urlopen(request)
46
print(response.read().decode())
47
except urllib.error.HTTPError as e:
48
print(e.read().decode())
Copied!
Response:
1
{"data":{"institution":{"name":"Test institution"}}}
Copied!

Session-based / GraphiQL

Institution administrators that are logged into Eduflow can access the API endpoint and query through the graphql interface.
When logged in, go directly to https://app.eduflow.com/api/graphql
Hovering over an object will show an introspection tooltip, typing will show autocompletion hints
GraphiQL has a searchable documentation available on the sidebar
If you access via browser, the GraphQL endpoint will show GraphiQL
To open GraphiQL's sidebar, mouseover an object in the query and click an object inside a tooltip, or clicking "Doc":
This is found on the top right of GraphiQL if the sidebar is closed.
GraphiQL works with both session-based (logged into app.eduflow.com) and by passing authorization headers.
Last modified 8mo ago