APIP7V1_CappInfo(zh-CN)



  • APIP7:CappInfo
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-01
    Update:2021-12-01
    Filehash:""
    TXid:
    

    #APIP7V1_CappInfo(zh-CN)

    ##目录

    关于APIP

    本协议的基本共识

    1.aid详情接口

    2.应用搜索接口

    3.应用历史接口

    4.应用评价列表接口


    Type:APIP
    SerialNumber:7
    ProtocolName:CappInfo
    Version:1
    Description:定义应用信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, capp, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供链上注册的各中密码应用的相关信息。

    2. 本协议接口的数据来源遵循以下协议:

      • 《FEIP15_CAPP》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.aid详情接口

    名称

    aidInfoList

    说明

    给定一个或多个aid获取相应应用详情。

    请求参数

    name type description
    aidList string array
    • 示例

    查询aid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的应用最新详情。

    参数

    {
    	"aidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/aidInfoList
    
    - unsignedRequest:
    
    {"aidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList"}
    
    - sign =sha256(sha256({"aidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"aidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    aidInfoList object See below.
    height uint The latest block height when getting the data.
    • aidInfoList
    name type description key in FEIP15
    aid string The ID of the capp,that is,the txid of the transaction in which the capp started up.
    stdName string The name of the capp in english data.stdName
    localName string array capp names in different languages data.localName
    desc string Description of this capp data.desc
    type string array The types of the capp data.type
    url string URL of the capp data.url
    prot string array The protocols followed by this CAPP data.prot
    serv string array The capps used by this CAPP data.serv
    pubKey string The public key designated by the publisher for this capp data.pubKey
    signer string The signer of the first input of the transaction in which the capp starts up.
    firstTime timeStamp The timeStamp of the transaction in which the capp was registered.
    lastTxid string The txid of the last operation of the capp.
    lastTime timeStamp The transaction timestamp of the last operation of the capp.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the capp in effect.
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的应用最新详情。
    {
    	"aidInfoList": [{
    			"aid": "000000001111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTime": 1636526891,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"aid": "2222222200000000000000000001111111111111111333333333333333",
    			"stdName": "Lianjia Housing agency",
    			"localName": "链家房屋中介",
    			"desc": "在世界各地提供优质的房屋中介应用。",
    			"type": ["House", "Agency"],
    			"url": "https://www.lianjia.com/index.html",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "000002020022222222222",
    			"signer": "F0000000000000008838dsjf",
    			"firstTime": 1619261292,
    			"lastTxid": "2222222200000000000000000001111111111111111333333333333333",
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"aidInfoList":[{"aid":"000000001111111111111111111111122222222222222222222222222","desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"aid":"2222222200000000000000000001111111111111111333333333333333","desc":"在世界各地提供优质的房屋中介应用。","firstTime":1619261292,"lastTime":1619261292,"lastTxid":"2222222200000000000000000001111111111111111333333333333333","localName":"链家房屋中介","prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"000002020022222222222","serv":["33333333333333333333333333","44444444444444444444444"],"signer":"F0000000000000008838dsjf","status":1,"stdName":"Lianjia Housing agency","tCdd":221800,"tRate":4.12,"type":["Agency","House"],"url":"https://www.lianjia.com/index.html"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7000 These AIDs do not exist. 这些AID不存在。 missedAidList
    7001 Too many AIDs are requested. 请求的AID数量太多。 maxAidCount
    • 示例
    {
    	"code": 7000,
    	"msg": "These AIDs do not exist.",
    	"data": {
    		"missedAidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 应用搜索接口

    名称

    cappSearch

    说明

    按条件查询应用。

    请求参数

    name type description required
    filterName string Filter by the stdName or localName N
    filterAddress string Filter by the designated address of the service,calculated from data.pubKey N
    filterType string Filter by the type of the capp N
    filterUrl string array Filter by URL N
    filterProt string The protocols followed by this CAPP data.prot
    filterServ string The capps used by this CAPP data.serv
    filterSigner string Filter by the signer N
    filterFirstTime string Filter by firstTime N
    filterLastTime string Filter by lastTime N
    filterTCdd string Filter by tCdd N
    filterTRate string Filter by tRate N
    filterStatus bool Sort by status N
    sortSigner string Sort by the signer N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by lastTime N
    sortTCdd string Sort by tCdd N
    sortTRate string Sort by tRate N
    sortStatus string Sort by status N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的应用,结果按综合评分tRate排序。

    参数

    {
    	"filterType": "API",
    	"filterUrl": "sign.cash",
    	"filterTCdd": "1000-",
    	"sortTRate": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/cappSearch
    
    - unsignedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch"}
    
    - sign =sha256(sha256({"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    cappList object See below.
    height uint The latest block height when getting the data.
    • cappList
    name type description key in FEIP15
    aid string The ID of the capp,that is,the txid of the transaction in which the capp started up.
    stdName string The name of the capp in english data.stdName
    localName string array capp names in different languages data.localName
    desc string Description of this capp data.desc
    type string array The types of the capp data.type
    url string URL of the capp data.url
    prot string array The protocols followed by this CAPP data.prot
    serv string array The capps used by this CAPP data.serv
    pubKey string The public key designated by the publisher for this capp data.pubKey
    signer string The signer of the first input of the transaction in which the capp starts up.
    firstTime timeStamp The timeStamp of the transaction in which the capp was registered.
    lastTxid string The txid of the last operation of the capp.
    lastTime timeStamp The transaction timestamp of the last operation of the capp.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the capp in effect.
    • 示例

    响应查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的应用,结果按综合评分tRate排序。

    {
    	"aidInfoList": [{
    			"aid": "11111111111111111111111111111122222222222222222222222222",
    			"stdName": "Freesign",
    			"localName": ["飞签"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["sign", "Basic capp"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"aid": "22222222222222222222222222222222220000000000000000000000",
    			"stdName": "cryptosign",
    			"localName": ["密签"],
    			"desc": "提供协议的查询",
    			"type": ["AID", "capp", "Basic capp"],
    			"url": "https://www.sign.cash/pidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "03002320000000000000000000000000000000000000",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "133429999900000000000000000000000000",
    			"lastTime": 1636526891,
    			"tCdd": 300000,
    			"tRate": 4.32,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"height":989430,"aidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"aid":"11111111111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"提供协议的查询","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"133429999900000000000000000000000000","localName":["协议信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"03002320000000000000000000000000000000000000","serv":["33333333333333333333333333","44444444444444444444444"],"aid":"22222222222222222222222222222222220000000000000000000000","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"protocol information API","tCdd":300000,"tRate":4.32,"type":["Basic API","PID","protocol"],"url":"https://www.sign.cash/pidInfo"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    signedRequest

    3. 应用历史接口

    名称

    aidHistory

    说明

    查询某aid应用的所有历史操作记录,不包括data.op值为“rate”的记录。

    请求参数

    name type description required
    aid string Y
    sortTxTimestamp string Sort by txTimestamp N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项aid为000000001111111111111111111111122222222222222222222222222的应用操作记录,按txTimestamp降序。

    参数

    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidHistory?count=20&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidHistory?count=20&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/aidHistory?count=20&filteOp=rate&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/aidHistory
    
    - unsignedRequest:
    
    {"count":20,"aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    aid string
    signer string The signer of the first input of the transaction in which the capp starts up.
    stdName string The recent name of the capp in english
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description
    op string The operation, "start", "update", "stop", or "restart".
    stdName string The name of the capp in english
    localName string array capp names in different languages
    desc string Description of this capp
    type string array The types of the capp
    url string URL of the capp
    prot string array The protocols followed by this CAPP
    serv string array The capps used by this CAPP
    pubKey string The public key designated by the publisher for this capp
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应aid为000000001111111111111111111111122222222222222222222222222的应用信息。
    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"stdName": "Freesign",
    	"aidInfoList": [{
    			"op": "stop",
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"stdName": "Freesign",
    			"localName": ["飞签"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"txTimestamp": 1610261291,
    			"txid": "3333333333333333333333333333388888888888888888888888888889",
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"aid":"000000001111111111111111111111122222222222222222222222222","aidInfoList":[{"block":989239,"op":"stop","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","localName":["免费cid信息接口"],"op":"update","prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"stdName":"Free cid API","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"}],"height":989430,"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","stdName":"Free cid API","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7002 The AID does not exist. 该AID不存在。 aid
    • 示例
    {
    	"code": 7002,
    	"msg": "The AID does not exist.",
    	"data": {
    		"aid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    4. 应用评价列表接口

    名称

    aidRateList

    说明

    查询对某aid应用的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    aid string Y
    filterRate uint Filter by data.rate N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Filter by txTimestamp N
    filterRater string Filter by the address of the first input of the rating transaction N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortRate string Sort by data.rate N
    sortRater string Sort by the address of the first input of the rating transaction N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项aid为000000001111111111111111111111122222222222222222222222222的应用的币天销毁大于1000的评分记录,按评分降序。

    参数

    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"filterCdd": "1000-",
    	"sortRate": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111111110000000000000000000000222222
    
    - signedRequest:
    
    https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000222222
    

    POST

    - URL:https://www.sign.cash/api/aidRateList
    
    - unsignedRequest:
    
    {"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList"}
    
    - sign =sha256(sha256({"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList","url":"https://www.sign.cash/api/aidRateList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    aid string
    rateList object See below.
    height uint The latest block height when getting the data.
    • rateList
    name type description
    rater uint The address of the first input of the rating transaction
    rate uint
    cdd uint64
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应aid为000000001111111111111111111111122222222222222222222222222的应用信息。
    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"rateList ": [{
    			"rater": "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy",
    			"rate": 5,
    			"cdd": 3100,
    			"txid": "3333333333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"rater": "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash",
    			"rate": 4,
    			"cdd": 10000,
    			"txid": "4444444333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618834297302,
    			"block": 989302
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    
    {"aid":"000000001111111111111111111111122222222222222222222222222","height":989430,"rateList ":[{"block":989302,"cdd":3100,"rate":5,"rater":"FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy","txTimestamp":"1618832997321","txid":"3333333333333333333333333333388888888888888888888888888889"},{"block":989302,"cdd":10000,"rate":4,"rater":"FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","txTimestamp":"1618834297302","txid":"4444444333333333333333333333388888888888888888888888888889"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7002 The AID does not exist. 该AID不存在。 aid
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 7002,
    	"msg": "The AID does not exist.",
    	"data": {
    		"aid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

Log in to reply