Open cforce opened 3 weeks ago
found the token, but still does not work to use the token in in a curl
#!/bin/bash
# Environment variable setup
#export DISCO_PROJECT_TOKEN=
# API URL
API_URL="https://production.gorillas.mercedes-benz.com/disco/v1/policyrules/XXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Output file
OUTPUT_FILE="policy_rules_output.json"
# Curl command to get data from the API using OAuth token
curl "$API_URL" \
-H "accept: application/json, text/plain, */*" \
-H "Authorization: Bearer $DISCO_PROJECT_TOKEN" \
-o "$OUTPUT_FILE"
# Check if the request was successful
if [ $? -eq 0 ]; then
echo "Data successfully written to $OUTPUT_FILE"
else
echo "Failed to retrieve data"
fi
Try prepending DISCO
to the token.
Still 404
#!/bin/bash
# Environment variable setup
#export DISCO_PROJECT_TOKEN=
# API URL
API_URL="https://production.gorillas.mercedes-benz.com/disco/v1/policyrules/XXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Output file
OUTPUT_FILE="policy_rules_output.json"
# Curl command to get data from the API using OAuth token
curl "$API_URL" \
-H "accept: application/json, text/plain, */*" \
-H "Authorization: Bearer DISCO ${DISCO_PROJECT_TOKEN}" \
-o "$OUTPUT_FILE"
# Check if the request was successful
if [ $? -eq 0 ]; then
echo "Data successfully written to $OUTPUT_FILE"
else
echo "Failed to retrieve data"
fi
There is a space missing between the token value and DISCO string.
How to create such token to authenticate? Is is a Tokenmaster token or is it gas/iamat or embeedded somewhwre is DISCO (where?)