Capture string from API Result in Python

Viewed 54

I am using python for an API. Based on the API Call I get the below result. I need to capture the progressId - "ES_0oEfQzNILXaBNuS" into a string and reuse it in the next API Call.

How do i capture this as a string in Python ?

print(response.text)
{"result":{"progressId":"ES_0oEfQzNILXaBNuS","percentComplete":0.0,"status":"inProgress"},"meta":{"requestId":"4ad2749a-7029-4d16-a691-f605bb5fb6f9","httpStatus":"200 - OK"}}
1 Answers

you can use: response.json().get('result').get('progressId')

Related