Skip to content

Instantly share code, notes, and snippets.

@akanchhaS
Last active January 23, 2024 17:02
Show Gist options
  • Save akanchhaS/ff6cbb42b77fc44c422e271ab5d4b76d to your computer and use it in GitHub Desktop.
Save akanchhaS/ff6cbb42b77fc44c422e271ab5d4b76d to your computer and use it in GitHub Desktop.
Snyk API auth
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