#albaro-report-api
1 messages · Page 1 of 1 (latest)
thank you!
That Retrieve File API expecting a file ID I believe.
Have you tried this step?
stripe.reporting.ReportRun.retrieve("{{REPORT_RUN_OBJECT_ID}}")
When the object succeeds, as in status is succeeded, we can download the CSV using the value of result.id from the object
I did and I get the below error:
InvalidRequestError: No such financereportrun:
I am grabbing the id from the object after the report runs
Can you give me the errored request id? req_xxx
You can find it in your Dashboard request log
req_mkLWHwn2btXvco
%7B%7Bfrr_1LaBsmJAmnYVOvfnoadXNDGs%7D%7D
You pass in something like this, probably encoding / utf problem?
You need to pass the exact Id frr_1LaBsmJAmnYVOvfnoadXNDGs
Now I get back an object but I can't access the data inside
How can I open the file in the object?
Did you try as the Doc suggested?
curl https://files.stripe.com/v1/files/{{REPORT_RUN_RESULT_ID}}/contents \
-u sk_test_xxx
I am trying to do this in a notebook so i want to open it using python
which is why I tried to follow the steps here https://stripe.com/docs/api/files/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okie, the result id starts with file_xxx correct?
yup
How was the Retrieve File API? did you get a response?
I did but I can't see anything
To be more specific I get back an object
but I don't see data to query
maybe because I am using my test key?
How does the object look like?
there is a links object and inside of a data key with an empty array
I guess this means that nothing was created?
Maybe the Report is still running?
hmm
If you using curl separately from your Notebook/Python and try to curl like the Doc, can you download the file?
When I run stripe.reporting.ReportRun.retrieve I see succeeded in the object
Let me try
I got some results after running the code in the shell
How do I now get it to work via python? Or is this not possible?
I did not get a file just some rows of data
hmm didn't that curl actually download a file with some rows of data? Sorry confused
It showed me some data in the shell but did not download anything
If that's test mode file could you screenshot?
(Don't share live mode screenshot here)
It is the test mode file but is it okay if I dm you the picture?
nevermind. How about the result when you called Retrieve File API? Pretty sure it won't have the file data so could you screenshot it?
This is what I see
Ah yes, so you have the "url" and it's the one if you curl with secret key, right?
yes
I think you may want to simulate that curl call inside Python. Maybe using requests? Try passing in the secret key and build the URL from the response above
Sorry no convenience SDK call for this
Pretty much how to use requests to pass parameters like -u
response = requests.get('https://files.stripe.com/v1/files/{{REPORT_RUN_RESULT_ID}}/contents', auth=('sk_test_xxx', ''))
Got it!!!!!
Thank you!!