閱讀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