API - atg.sh

#!/bin/bash

# Retrieve Token from application
token=$(curl --silent --location --request POST "https://x.x.x/api/v1/auth/login" \
  --header "Content-Type: application/json" \
  --data "{
        \"email\" : \"[email protected]\",
        \"password\" : \"x\"
}" | jq .token | sed s/\"//g)

# Using token request some data
curl --silent --location --request GET "https://x.x.x/api/v1/reports/x" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer $token " | jq