Last active
January 23, 2024 17:02
-
-
Save akanchhaS/ff6cbb42b77fc44c422e271ab5d4b76d to your computer and use it in GitHub Desktop.
Snyk API auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
SNYK_TOKEN = "add snyk token here" | |
# API endpoint url | |
url = "https://api.snyk.io/rest/orgs?version=2023-08-29&limit=100" | |
headers = { | |
'Accept': 'application/vnd.api+json', | |
'Authorization': f'token {SNYK_TOKEN}' # <-- SNYK_TOKEN referenced here | |
} | |
# make request here | |
res = requests.request("GET", url, headers=headers) | |
# process response here | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment