cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Who Me Too'd this topic

Prisma Cloud API returning 401 Unauthorized

L0 Member

I am trying to retrieve some scans and am receiving a 401 error.  The access key has the System Admin role.  Suggestions?  Thank you.  

 

API="https://us-east1.cloud.twistlock.com/us-2-XXXXXXXXX"

# Get Token
JWT="$(curl -s ${API}/api/v22.06/authenticate -X POST -H 'Content-Type: application/json' \

           -d '{"username":"MyAccessKeyID","password":"MySecretKey"}' | jq '.["token"]' | tr -d '"' )"

# Create header with token
HEADER="Authorization: Bearer ${JWT}"

RESPONSE="$(curl -i ${API}/api/v22.06/scans -i -H '${HEADER}' -H 'content-type: application/json; charset=UTF-8' )"
echo $RESPONSE

 

Who Me Too'd this topic