If any one struggled with "deployments API" here is a Python script that works

Hi, I had a hard time trying to convince the API endpoint to accept my curl requests. It wasn’t accepting any API credentials. The issue was caused by the wrong API endpoint stated in the docs. It looks like that EU region has its own API endpoint api.eu.newrelic.com and the api.newrelic.com doesn’t work :(.

Another issue was my timestamp format, the PUT method does not allow for timestamps with time zone information and expects the UTC time, even though the time zone is provided in the output of the list command.

So to make things easier I’ve created a small python script that works for the EU region and handles the local time to UTC conversion.

I’m sharing it here as it might be useful for others, if it is in wrong place let me know.

1 Like

HI @piotr.czapla

WOW! thank you so much for sharing this. This is amazing, I know other community members will find it so helpful.

Its great to see community members get involved like this. I have also reached out via direct message to confirm some details with you, as I would love to send you some New Relic Swag as an additional extension of our appreciation.