表单 API 、 数据 API 以及未来的所有的 API 都需要验证才能访问。
⚠️注意:金数据目前仅支持 HTTP Basic 的验证方式。
你可以在「个人中心——API」中,找到自己的 API Key 和 Secret 。
你可以在「系统设置——企业 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)
其他语言,请参照对应的语言及语法实现。