阅读585 返回首页    go 金数据


获取API访问Key/Secret

除了数据推送API表单API数据API以及未来的所有的API都需要验证才能访问。

金数据目前仅支持HTTP Basic的验证方式。

您可以在 个人中心——API 中,找到自己的API Key和Secret。 您每次进行API调用时,都需要将API Key&Secret放到HTTP请求的Header中。 例如,使用curl来获得某个表单的定义:

curl -u bb0e1736d66744495b814b942fd04a80:0e11dda88048ed52cc8758caf06dc6b4 https://jinshuju.net/api/v1/forms/ex27t2

或通过Ruby来获得某个表单的定义:

require 'rest_client'

response = RestClient::Request.new(
    :method => :get,
    :url => 'https://jinshuju.net/api/v1/forms/ex27t2',
    :user => 'bb0e1736d66744495b814b942fd04a80',
    :password => '0e11dda88048ed52cc8758caf06dc6b4',
    :headers => { :accept => :json,
    :content_type => :json }
  ).execute
results = JSON.parse(response.to_str)

其他语言,请参照对应的语言及语法实现。

最后更新:2017-01-14 10:04:31

  上一篇:go 数据及流量扩容与数据恢复
  下一篇:go 表单API