0
I am trying to fetch some data via NewRelic’s NerdGraph GraphQL API.
url="https://api.newrelic.com/graphql"
headers={"API-Key": api_key}
nrql="""query{
actor {
account(id: 1234) {
name
}
}
}
"""
response=requests.get(url=url, headers=headers, json={'query': nrql})
However, I am getting an error.
{'errors': [{'locations': [{'column': 2, 'line': 1}], 'message': 'syntax error before: "\"query\""'}]}
The same query works in NerdGraph API Explorer application in New Relic. What could be wrong here?
|