9. 验证Credential

调用接口:

标题描述
接口名weid/api/invoke
MethodPOST
Content-Typeapplication/json

接口入参:

KeyValueRequired
functionNamecreateCredentialY
functionArg Y
functionArg.claimclaim Json 结构体,与 SDK直接调用的方式入参 一致,下同Y
functionArg.cptIdCPT IDY
functionArg.contextcontext值Y
functionArg.uuidCredential的UUIDY
functionArg.issuerissuer WeIdentity DIDY
functionArg.issuranceDate颁发时间Y
functionArg.expirationDate过期时间Y
functionArg.signatureCredential签名值Y
transactionArg N,传空
v版本号Y

接口入参:

  1. {
  2. "functionArg": {
  3. "@context": "https://www.w3.org/2018/credentials/v1",
  4. "cptId": 10,
  5. "uuid" : "decd7c81-6b41-414d-8323-00161317a38e",
  6. "issuer": "did:weid:0x12025448644151248e5c1115b23a3fe55f4158e4153",
  7. "issuranceDate": "2019-03-19T21:12:33Z",
  8. "expirationDate": "2019-04-18T21:12:33Z",
  9. "claim": {
  10. "name": "zhang san",
  11. "gender": "F",
  12. "age": 18
  13. },
  14. "signature": "MTIzNDU2NzgxMjM0NTY3ODMzMzM0NDQ0MTIzNDU2NzgxMjM0NTY3ODEyMzQ1Njc4MTIzNDU2NzgxMjM0NTY3ODU="
  15. },
  16. "transactionArg": {
  17. },
  18. "functionName": "verifyCredential"
  19. "v": "1.0.0"
  20. }

接口返回: application/json

KeyValue
ErrorCode错误码,0表示成功
ErrorMessage错误信息
respBodyTrue/False

接口返回:

  1. {
  2. "respBody": true,
  3. "ErrorCode": 0,
  4. "ErrorMessage": "success"
  5. }