Skip to content

Commit 49cf11b

Browse files
authored
Merge pull request #3158 from OpenC3/wait_default
Fix documented default for quiet param
2 parents 00d9059 + f332e1d commit 49cf11b

File tree

2 files changed

+249
-158
lines changed

2 files changed

+249
-158
lines changed

docs.openc3.com/docs/guides/curl.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,23 @@ Before diving too deeping into `curl` make sure what you're trying to accomplish
1313

1414
## Curl Example with OpenC3 COSMOS Core
1515

16-
OpenC3 COSMOS Core just has a single user account, so all you need to do is pass the single password as the token with your requests like this.
16+
OpenC3 COSMOS Core just has a single user account, but since COSMOS 7.0.0 you must first obtain a token:
1717

1818
Request:
1919

2020
```bash
21-
curl -i -H "Content-Type: application/json-rpc" -H "Authorization: eyJhbGciOiJSUzI1NiIsInR5cCI...<access_token>" \
21+
TOKEN=$(curl -s -X POST "http://localhost:2900/openc3-api/auth/verify" \
22+
-H "Content-Type: application/json" \
23+
-d '{"password": "password"}')
24+
curl -i -H "Content-Type: application/json-rpc" -H "Authorization: $TOKEN" \
25+
-d '{"jsonrpc": "2.0", "method": "tlm", "params": ["INST HEALTH_STATUS TEMP1"], "keyword_params": {"scope": "DEFAULT"}, "id": 8}' \
26+
-X POST http://127.0.0.1:2900/openc3-api/api
27+
```
28+
29+
In COSMOS 6 you can directly pass the password:
30+
31+
```bash
32+
curl -i -H "Content-Type: application/json-rpc" -H "Authorization: password" \
2233
-d '{"jsonrpc": "2.0", "method": "tlm", "params": ["INST HEALTH_STATUS TEMP1"], "keyword_params": {"scope": "DEFAULT"}, "id": 8}' \
2334
-X POST http://127.0.0.1:2900/openc3-api/api
2435
```

0 commit comments

Comments
 (0)