The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

Getting 401 error when query getScanConfigurations

Siva | Last updated: Dec 07, 2020 05:46PM UTC

Hello, I seem to be having trouble making a simple query on the Burp Suite Enterprise GraphQL API. I keep getting a 401 error. This is my code snippet. Would greatly appreciate any help! ============================= burpEndpoint = '<Enterprise_server_url>/api/graphql/v1' apiToken = <Token that I was given> #Checked that token is still valid headers = {"Authorization": "bearer {}".format(apiToken)} def run_query(query): request = requests.post(burpEndpoint, query, headers) if request.status_code == 200: return request.json() else: raise Exception("Query failed to run by returning code of {}. {}".format(request.status_code, query)) query = """ { query getScanConfigurations { scan_configurations { id name } } } """ result = run_query(query) print(result)

Michelle, PortSwigger Agent | Last updated: Dec 08, 2020 01:30PM UTC