9. 验证Credential
调用接口:
标题 | 描述 |
---|---|
接口名 | weid/api/invoke |
Method | POST |
Content-Type | application/json |
接口入参:
Key | Value | Required |
---|---|---|
functionName | createCredential | Y |
functionArg | Y | |
functionArg.claim | claim Json 结构体,与 SDK直接调用的方式入参 一致,下同 | Y |
functionArg.cptId | CPT ID | Y |
functionArg.context | context值 | Y |
functionArg.uuid | Credential的UUID | Y |
functionArg.issuer | issuer WeIdentity DID | Y |
functionArg.issuranceDate | 颁发时间 | Y |
functionArg.expirationDate | 过期时间 | Y |
functionArg.signature | Credential签名值 | Y |
transactionArg | N,传空 | |
v | 版本号 | Y |
接口入参:
- {
- "functionArg": {
- "@context": "https://www.w3.org/2018/credentials/v1",
- "cptId": 10,
- "uuid" : "decd7c81-6b41-414d-8323-00161317a38e",
- "issuer": "did:weid:0x12025448644151248e5c1115b23a3fe55f4158e4153",
- "issuranceDate": "2019-03-19T21:12:33Z",
- "expirationDate": "2019-04-18T21:12:33Z",
- "claim": {
- "name": "zhang san",
- "gender": "F",
- "age": 18
- },
- "signature": "MTIzNDU2NzgxMjM0NTY3ODMzMzM0NDQ0MTIzNDU2NzgxMjM0NTY3ODEyMzQ1Njc4MTIzNDU2NzgxMjM0NTY3ODU="
- },
- "transactionArg": {
- },
- "functionName": "verifyCredential"
- "v": "1.0.0"
- }
接口返回: application/json
Key | Value |
---|---|
ErrorCode | 错误码,0表示成功 |
ErrorMessage | 错误信息 |
respBody | True/False |
接口返回:
- {
- "respBody": true,
- "ErrorCode": 0,
- "ErrorMessage": "success"
- }