Quick start
Quick start
Prerequisites:
- Riversoft® STCP Gemini API installed and running. See Riversoft STCP Gemini installation.
- A Riversoft Console Portal operator with query permission.
curland, optionally,jq.
Set the API address
export API_BASE='https://api.example.com:33070'Obtain the access token
read -r -p 'Operator: ' API_USER
read -r -s -p 'Password: ' API_PASSWORD; printf '\n'
ACCESS_TOKEN=$(curl -s \
--data-urlencode 'grant_type=password' \
--data-urlencode "username=$API_USER" \
--data-urlencode "password=$API_PASSWORD" \
"$API_BASE/oauth/token" | jq -r .access_token)Note
POST /oauth/token does not apply two-factor authentication (2FA). If 2FA is enabled in the API registration, or if the operator signs in through LDAP, obtain the token as in Local sign-in and 2FA.
Query the transfer history
START=$(( $(date -d '1 day ago' +%s) * 1000 ))
END=$(( $(date +%s) * 1000 ))
curl -s -G \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Accept: application/json' \
--data-urlencode 'instance=STCPGEMINI' \
--data-urlencode 'events=5' --data-urlencode 'events=7' \
--data-urlencode "start=$START" --data-urlencode "end=$END" \
--data-urlencode 'limit=100' \
"$API_BASE/reports/v2/transfers"The response carries the records in data and the next page in next.
End the session
curl -s -X DELETE \
-H "Authorization: Bearer $ACCESS_TOKEN" \
"$API_BASE/disconnect/api/v3/logout"Next steps: see the other reports and the API reference.