Syntax error wile trying out NRQL in NewRelic

Syntax error wile trying out NRQL in NewRelic


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?

Share
Improve this question


Load 7 more related questions


Show fewer related questions

0

Reset to default



Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *