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

Calling Burp GraphQL API on python

Lionel-Junzer | Last updated: Aug 05, 2020 08:56AM 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': 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 scanConfigurationsQuery() { scan_configurations() { id name } } } """ result = run_query(query) print(result)

Michelle, PortSwigger Agent | Last updated: Aug 05, 2020 11:35AM UTC

Hi We've replied to the email you set us, please let us know how you get on.

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

Even I am getting the same error. Could you please help me out?

Michelle, PortSwigger Agent | Last updated: Dec 08, 2020 09:52AM UTC