Incorrect Ticket ID is being output when trying to map ticket_metrics and tickets API I am trying to write a script that will outputs the following: if group_id == 6177821616923 output ticket_id, created_at, reply_time_in_minutes, on_hold_time_in_minutes What's happening is that each time my script outputs, it outputs the same ticket ID for each iteration. I am sure this is something small. I am trying to map these API's together based on the ticket ID. Open to suggestions on how to make this better and more efficient.
import requests
# Constants
AUTH = 'andrew.e@coinmetrics.io/token', 'my_key'
HEADERS = {"Content-Type": "application/json"}
def cse_tickets(ticket_id):
url = "https://coinmetricshelp.zendesk.com/api/v2/tickets/"
response = requests.get(url, auth=AUTH, headers=HEADERS)
if response.status_code == 200:
data = response.json()
tickets = data.get('tickets')
for ticket in tickets:
if