Importing an API call from a Stripe cURL to API connector

Hello people,

I’m having trouble with the “import another call with cURL” function in the API connector. I’m taking the following steps:

  1. setup headers with Secret Keys

  2. Copy cURL from Stripe - for example Usage reporting

  3. Paste into import window
    import window

  4. Substitute in an existing Subscription Item ID for testing

I then get the following error on initialising:

Can anyone see where I have gone wrong?

Is it a formatting error?

Appreciate any help with this.

Thanks!
Mihira

400 error would be a general error on Stripes side. Maybe try postman or curl on your own machine to make it 100% work then try it on bubble? Using bubble directly without testing could work but it adds additional complexity to troubleshoot.

Thanks! i’m going to look up how to use postman and test there for now.

Postman is great for API’s. If you want to just get this done, consider using curl directly on your machine…if you are using linux or mac, it’s already in your terminal. If you are using windows you can quickly install it then copy/paste your command above to see if it works.

Good luck!

Ah I see, thanks for clarifying. I will try this out.

@gautam.bakshi, I tried copying this curl to test this out:
curl test

I get this error:

Do you have any idea why the API key would not be going through?

This is highly specific to stripe. I’m not sure how much I can help since I haven’t used it ever. A few ideas:

  1. I do not see you sending your token
  2. your command is breaking up. See after you enter the command it partly executes. I do not use windows but I think the \ to break to new line doesn’t work on windows the same way.

Ok thanks for taking a look. What I did is copy and paste it at the command prompt as it is below:

curl https://api.stripe.com/v1/prices
-u sk_test_xxxxxxxxxxxxxxxxxxxxxxxxx:
-d currency=aud
-d “recurring[interval]”=month
-d “recurring[usage_type]”=metered
-d “product_data[name]”=“Gold special”
-d nickname=“Gold special price”
-d unit_amount=3000

and it executes before I can do anything else. The API key is in the second line.

I’ll reach out to stripe and see what they say.

Thanks again.

1 Like