#s1nergy

1 messages ยท Page 1 of 1 (latest)

low gladeBOT
simple sky
#

Hello, can you explain your situation a bit more? What webhook are you listening for and what are you doing that cannot access files.stripe.com?

mental spear
#

Hello, yes of course. I am trying to listen sigma scheduled query run.created event but in stripe cli i am trying to run this command: curl https://files.stripe.com/v1/files/{{ FILE ID }}/contents -u sk_: I am putting my live key and when I search in browser https://files.stripe.com/v1/files it pops up a window where I put my credentials (that I have in dashboard also) but cant enter there. What is the other way to find my scheduled query file id to put it in cli? And also I cant put host live password in cli

simple sky
#

Are you working in the android SDK? If not I can try to find a doc with a coding example in your language of choice

mental spear
#

No, I am not working in the Android SDK. Via Python I tried to find the file but there are thousands of them and I don`t know how to filter out scheduled files with results. Is it possible to do that next to this code?
import stripe
stripe.api_key = "sk_live_XXX"

stripe.File.list(limit=30)

#

But still whenever we find the file, how do I schedule that file in cli when I can`t just put my host password

low gladeBOT
simple sky
#

Have you been following a specific document for this process? I think I am unfamiliar with how this API is typically used in your scenario and seeing that could help me understand

mental spear
#

I am using this documentation

#

I am trying to get that file to schedule it afterwards into the google sheet or MSSQL server. Is it possible ?

simple sky
#

Thank you for the doc that was helpful. To take a step back, are you running that curl command in your command line or did you run it somewhere else?

mental spear
#

I am running it in Stripe CLI

#

I downloaded it from github (windows version)

simple sky
#

We don't support automatically making a sheet or MYSQL upload but you use custom code can automate one

#

Does the command successfully run in the CLI?

mental spear
#

Command runs successfully but in the end it asks me for the host password and I can`t put any credentials

simple sky
#

Can you try hitting enter to just send without a password?

#

We don't expect one as far as I know

mental spear
#

It brings an invalid error

simple sky
#

Double checking something one sec...

mental spear
#

Oh

#

Whenever I put enter its not about the password. Its about the content that I have in the url. If I manage to get the file ID I can put that there and maybe then it will move forward

simple sky
#

Yes, the command is expecting a valid file ID

#

I think our doc assumes you will just get the ID from the webhook that we sent you

#

but if you want to list them from the API for testing, it looks like you can list your files and filter on purpose='sigma_scheduled_query'

mental spear
#

Ok, I will try that

#

Is it possible to filter out that ID via python?

import stripe
stripe.api_key = "sk_live_XXX

stripe.File.list(limit=30)

#

How to add purpose here?

simple sky
#

The purpose field is automatically set by the system.

#

Is it possible to filter out that ID via python?
I'm not clear on this question. Can you clarify what you mean here?

mental spear
#

By this code as I understand I can list all the files. I just to filter out file id for the sigma_scheduled_query to put it in the Stripe CLI. Maybe I misunderstand something here

simple sky
#

Can you try running the list files API call and use purpose='sigma_scheduled_query' to filter? I think that will help clarify this

#

Basically, sigma_scheduled_query is an entire type of file. When you filter on that purpose, you will get a list of all the files on your account that were created from a sigma scheduled query

mental spear
#

Ok, I will try to filter out that in Stripe CLI

#

Brought this error

"error": {
"message": "Invalid purpose: must be one of account_requirement, additional_verification, business_icon, business_logo, customer_signature, dispute_evidence, document_provider_identity_document, finance_report_run, identity_document, identity_document_downloadable, pci_document, selfie, sigma_scheduled_query, tax_document_user_upload, or terminal_reader_splashscreen",
"param": "purpose",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_ActTY2bZPkfeDj?t=1684766473",
"type": "invalid_request_error"

simple sky
#

It looks like the equals sign and quotes got passed in as part of the param that you sent

  purpose: "='sigma_scheduled_query'",
}``` https://dashboard.stripe.com/test/logs/req_ActTY2bZPkfeDj
#

So the syntax may be slightly different from what you are using

mental spear
#

If I am not putting equal sign it brings an error that purpose is an unknown flag

#

stripe files list --purpose="sigma_scheduled_query" how to write this in Stripe CLI or in python?

#

I have done it in python

#

import stripe
stripe.api_key = "sk_live_XXX

stripe.File.list(purpose= "sigma_scheduled_query")

sharp aurora
#

Hello ๐Ÿ‘‹
Stepping in as Pompey had to step away

#

Can you give me a quick summary on what you're blocked on?

mental spear
#

Hi Hanzo

#

We figured out the half of it with Pompey )))
Now when I have the file id how do I proceed with that to schedule my query. I am having trouble to understand how to listen to Stripe events where I have to put endpoint URL and to choose my sigma.scheduled_query_run.created event

#

As an endpoint URL what do I put?

sharp aurora
#

the endpoint would be the address where your webhook code is hosted. For example,
https://stripe.com/docs/webhooks

If you're running a local server then the endpoint URL should be something like http://localhost:3000/webhooks

mental spear
#

I have this returned when I filter for my file ID

<ListObject list at 0x17d7fbde630> JSON: {
"data": [
{
"created": 1684400894,
"expires_at": null,
"filename": "Monthly_Stripe_Charges_20230517.csv",
"id": "file_1N92okCo0DjamzRAawVtAHYj",
"links": {
"data": [],
"has_more": false,
"object": "list",
"url": "/v1/file_links?file=file_1N92okCo0DjamzRAawVtAHYj"
},
"object": "file",
"purpose": "sigma_scheduled_query",
"size": 3190043,
"title": "Monthly Stripe Charges for 2023-05-17",
"type": "csv",
"url": "https://files.stripe.com/v1/files/file_1N92okCo0DjamzRAawVtAHYj/contents"
}
],
"has_more": false,
"object": "list",
"url": "/v1/files"

#

From here I took the url as an endpoint

#

Is it possible to integrate this results from stripe to google sheet (I can specify) or MSSQL?

sharp aurora
#

Ah that's not something our team on discord would know unfortunately.
We're not experts on sigma ๐Ÿ˜ฆ

I'd recommend working with our support team as they can put you in touch with team specializing in sigma and can help with granular detail
https://support.stripe.com/?contact=true

mental spear
#

Ok, thank you so much Hanzo ))