https://prefect.io logo
l

Luis Aguirre

01/21/2022, 5:02 PM
Hi, I'm trying to get the response of a flow run through the REST API. I'm using `fetch(`http://localhost:4200/api/flow_runs/${response.id}`` to fetch the data and just getting
*data*: {encoding: 'orion', blob: '{"encoding": "file", "blob": "file:///tmp/78442fec16214918a437e768fa384762"}'}
in the
state
section. Is there something I should configure to get the whole response? Thanks
k

Kevin Kho

01/21/2022, 5:21 PM
If using the Python client, you can do 
state_data = state.result()
l

Luis Aguirre

01/21/2022, 5:47 PM
Thanks @Kevin Kho, but I'm instead calling those requests in a JavaScript environment
I'm using Prefect Orion
k

Kevin Kho

01/21/2022, 5:49 PM
Yeah the Python Client was for Orion. If you are in a JS environment, you can try hitting the
/api/data/retrieve
 endpoint with the 
data
 from the flow run response.
You may have a rough time using JS. It’s not recommended
l

Luis Aguirre

01/23/2022, 5:18 PM
Thanks @Kevin Kho the endpoint worked fine, but the response is retrieved with the info pickled and I could not find how to unpickle in a Javascript environment, I'll try something else
5 Views