简体   繁体   English

我如何使用脚本获取Plaid API返回的响应

[英]how can I get response returned by Plaid api using script

I am trying to connect to the Plaid api using Ruby. 我正在尝试使用Ruby连接到Plaid API。 But I am trying to connect it using <script> tag. 但是我正在尝试使用<script>标记连接它。 I have successfully connected to their api and there is a json object returned in the response as I can see it in browser's console. 我已经成功连接到他们的api,并且在响应中返回了一个json对象,正如我在浏览器控制台中看到的那样。 But I am unable to get it in my code. 但是我无法在我的代码中得到它。 My code is 我的代码是

    <%= form_for :user, method: :get, :html => { :id => "link-form-id" } do |f| %>
<% end %>

<script
  src="https://cdn.plaid.com/link/stable/link-initialize.js"
  data-client-name="Mandeep"
  data-client-id="**********"
  data-form-id="link-form-id"
  data-key="***********"
  data-product="auth"
  data-env="tartan">
</script>

This code returns json object in url as well. 这段代码还会在url中返回json对象。 I dont understand how can I get it from <script> tag. 我不明白如何从<script>标签获取它。 I have searched all over the web but couldn't get any useful stuff. 我在网上搜索了所有内容,但找不到任何有用的东西。 Can you please help me to find this out. 你能帮我找到答案吗? Your help would be appreciated. 您的帮助将不胜感激。 Thanks 谢谢

由于表单的方法是“ GET”,因此您需要解析查询字符串以检索“格子链接” public_token(因此,您将需要在查询字符串中查找“ public_token”字段)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM