You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
862 B
21 lines
862 B
#!/bin/bash |
|
echo "=== Login ===" |
|
RESP=$(curl -sk -X POST https://console.gisportal.id/api/v1/auth/login \ |
|
-H 'Content-Type: application/json' \ |
|
-d '{"username":"rbsetiawan","password":"Rifqi123"}') |
|
echo "$RESP" | python3 -m json.tool 2>/dev/null | head -5 |
|
|
|
TOKEN=$(echo "$RESP" | python3 -c 'import sys,json; d=json.load(sys.stdin); print(d.get("data",{}).get("token",""))' 2>/dev/null) |
|
echo "Token: ${TOKEN:0:30}..." |
|
|
|
echo "" |
|
echo "=== GET /api/v1/ai/status ===" |
|
curl -sk https://console.gisportal.id/api/v1/ai/status \ |
|
-H "Authorization: Bearer $TOKEN" | python3 -m json.tool |
|
|
|
echo "" |
|
echo "=== POST /api/v1/ai/chat ===" |
|
curl -sk -X POST https://console.gisportal.id/api/v1/ai/chat \ |
|
-H "Authorization: Bearer $TOKEN" \ |
|
-H 'Content-Type: application/json' \ |
|
-d '{"message":"di mana route untuk feedback di geonet-console?"}' | python3 -m json.tool
|
|
|