PagerDuty / pdpyras

Low-level PagerDuty REST/Events API client for Python
MIT License
129 stars 29 forks source link

Support for Analytics API #59

Closed ocafebabe closed 3 years ago

ocafebabe commented 3 years ago

Hello,

I'm trying to query the PD Analytics API but I get a permission error: API responded with non-success status (403)

Based on the documentation, it seems that we have to pass the X-EARLY-ACCESS header in order to use it.

Is there a way to do this using this client?

Thanks

ocafebabe commented 3 years ago

Never mind, I was able to call the API using the "get" method directly, e.g.:

analytics = session.get('/analytics/raw/incidents/%s' % (i['id']), headers={'X-EARLY-ACCESS': 'analytics-v2'})