-
Notifications
You must be signed in to change notification settings - Fork 4
/
api.scouting.org-command.sh
37 lines (25 loc) · 1.03 KB
/
api.scouting.org-command.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# shellcheck disable=SC1091
source config.sh
# HTTPie doesnt support defining requests in a dedicated file, but we can still script it
CMD="http"
OPTS="--ignore-stdin"
# advancements/ranks
## get all ranks as a JSON object
"$CMD" "$OPTS" "$OPTIC_PROXY"/advancements/ranks
## ranks invalid parameter
"$CMD" "$OPTS" "$OPTIC_PROXY"/advancements/ranks\?foo
## rank requirements
"$CMD" "$OPTS" "$OPTIC_PROXY"/advancements/ranks/1/requirements
# advancements/youth
## authorization failure
"$CMD" "$OPTS" "$OPTIC_PROXY"/advancements/youth/123457890/
## not found
"$CMD" "$OPTS" "${OPTIC_PROXY}/advancements/youth/${userId}/" "Authorization: Bearer ${TOKEN}"
## method not allowed
"$CMD" "$OPTS" "${OPTIC_PROXY}/advancements/youth/${userId}" "Authorization: Bearer ${TOKEN}"
## leadership history
"$CMD" "$OPTS" "${OPTIC_PROXY}/advancements/youth/${userId}/leadershipPositionHistory" "Authorization: Bearer ${TOKEN}"
# data lookups
## get all countries as a JSON object
"$CMD" "$OPTS" "$OPTIC_PROXY"/lookups/address/countries