Use data from api

  • ssssadsadasd-1336652083138658356

    ssssadsadasd

    3 months ago

    I have an api named "stripe_api" that creates a stripe customer.
    This call returns this json (see attached image).
    On success, I want to make a Patch call to my Supabase to edit the stripe_customer_key field. How can I extract the stripe_api.data.id value as an input for the subsequent call (the supabase one)?

    I tried using dot notation stripe_api.data.id but it evaluates to text and it does not extract the value.


    thanks
    1336652083499237427-image.png
    1
  • max.kayr-1336653126081577063

    Max

    3 months ago

    You can use the "Get" node. But this is functionality that should go in the backend, not toddle
  • ssssadsadasd-1336653787225657375

    ssssadsadasd

    3 months ago

    ah ok, pushing it to the backend makes sense thanks. two quick questions:
    1. what do you mean with "get" node? or simply a stripe api call to get the customer
    2. in this case and in general, why the call should go to the backend? I am not exposing any stripe keys or similar @Max
  • ssssadsadasd-1336654212259643462

    ssssadsadasd

    3 months ago

    I mean technically all the calls are happening in the backend
  • max.kayr-1336654393688199248

    Max

    3 months ago

    1. When you receive the data, you can use a formula and in this formula you need to add the "Get" node to get the key (this is like dot notation)
    2. If you keep this in your frontend, you are allowing your users to set their stripe id. They should not be able to do that
  • ssssadsadasd-1336654562018201653

    ssssadsadasd

    3 months ago

    got it thanks 👍
    💪1
  • lucasg-1336707705087328318

    Lucas G

    3 months ago

    Should also just be able to select the value right from the call result
  • ssssadsadasd-1336709328836755529

    ssssadsadasd

    3 months ago

    @Lucas G hmm not sure how can I access it.this call returns a url but if I want to set a variable in the "event" how can I use the url?
    1336709328236974173-image.png
    1336709328572387419-image.png
  • lucasg-1336711190918729801

    Lucas G

    3 months ago

    Use it where?
  • If in another API, you can use the new inputs directly without needing a variable
  • ssssadsadasd-1336711957138641008

    ssssadsadasd

    3 months ago

    So, I make a stripe api call -> this returns a url -> after it was successful (events -> on success) -> go to page = url
  • lucasg-1336713248019451975

    Lucas G

    3 months ago

    Yeah don’t need variables, just just use the go to url directly
  • lucasg-1336713539687022592

    Lucas G

    3 months ago

    You can use API data anywhere
  • ssssadsadasd-1336714575529382032

    ssssadsadasd

    3 months ago

    @Lucas G ah yeah you mean simply doing what I do in the second pic? yeah, did not think it that way. thanks
  • lucasg-1336718718188654623

    Lucas G

    3 months ago

    Well even when using the data inside other API calls. You can just use it directly
  • ssssadsadasd-1336720254596026459

    ssssadsadasd

    3 months ago

    @Lucas G I am not sure I understand how can I use directly without making the call again? the url cannot be found in variables, attributes, etc.
  • lucasg-1336725252624875602

    Lucas G

    3 months ago

    When a call is made, the data doesn't just disappear. It remains and then it can be used anywhere after that
  • Inside formulas, in other APIs, etc