文档
测试
POST
https://foxconn.gateway.api.liyueyun.com/api/TOEvidence/evidences

接口描述

创建分组

headers

参数名
类型
描述
必填
Authorization
string
Bearer AccessToken
必填

body参数

application/x-www-form-urlencoded
参数名
类型
描述
必填
evidence
string
待存储的信息(最大256KB)
必填

响应参数

参数名
类型
描述
必填
evidenceId
string
存证id
必填

说明 / 示例

**发起存证请求,若是机密信息,可在调用前对信息进行编码后再上传,未来取证时会将此时传入的证据文本与区块链上的文本进行对比。** **存证容量最大256KB。** **请保存返回参数中的存证id,以便后续查询使用。** **请求头中需附带Bearer AccessToken 。** **调用成功返回包含存证id的对象: { evidenceId: xxx }** #### 错误列表 |httpCode|error|message| |-|-|-| |403|SecretIsInvalid|无效的 secret| |403|EVIDENCE_IS_TOO_LONG|存证内容超出限制(256KB)| ### 各平台的代码示例 ##### C#访问示例代码: ```CSharp var client = new RestClient("https://foxconn.gateway.api.liyueyun.com/api/TOEvidence/evidences"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer AccessToken"); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("evidence", "xxxxxx"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); ``` ##### Java访问示例代码: ~~~ java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); RequestBody body = RequestBody.create(mediaType, "evidence=xxxxxx"); Request request = new Request.Builder() .url("https://foxconn.gateway.api.liyueyun.com/api/TOEvidence/evidences") .method("POST", body) .addHeader("Authorization", "beare AccessToken") .addHeader("Content-Type", "application/x-www-form-urlencoded") .build(); Response response = client.newCall(request).execute(); ~~~ #### Nodejs访问示例代码: ~~~javascript var axios = require('axios'); var qs = require('qs'); var data = qs.stringify({ 'evidence': 'xxxxxx' }); var config = { method: 'post', url: 'https://foxconn.gateway.api.liyueyun.com/api/TOEvidence/evidences', headers: { 'Authorization': 'beare AccessToken', 'Content-Type': 'application/x-www-form-urlencoded' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); }); ~~~ #