Sign document
POST/api/management/signature/sign
Sign a JSON document with default or defined key
Request
- application/json
Bodyrequired
typestring
Possible values: [JsonWebSignature2020
, DataIntegrityProof
]
Example:
{"type":"JsonWebSignature2020"}
plainDocumentobjectrequired
Example:
{"id":"document1","content":"This is a sample document"}
keyIdstring
Example:
did:example:12345
normalizationstring
Possible values: [RDFC
, JCS
]
Default value:
RDFC
Example:
RDFC
proofPurposestring
Default value:
assertionMethod
Example:
assertionMethod
options object
embeddedVerificationMethodboolean
Default value:
false
Example:
false
Responses
- 200
- 403
- 404
- application/json
- Schema
- Example (auto)
Schema
proof objectrequired
{
"proof": {
"type": "JsonWebSignature2020",
"proofPurpose": "assertionMethod"
}
}
Forbidden
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Resource not found
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Authorization: oauth2
name: oauth2type: oauth2scopes:wallet_use_keys,wallet_manage_keys
flows: { "password": { "scopes": { "wallet_view_did": "wallet_view_did", "wallet_manage_keys": "wallet_manage_keys", "wallet_use_keys": "wallet_use_keys", "wallet_view_own_credentials": "wallet_view_own_credentials", "wallet_view_all_credentials": "wallet_view_all_credentials", "wallet_manage_own_credentials": "wallet_manage_own_credentials", "wallet_manage_all_credentials": "wallet_manage_all_credentials", "wallet_issue_credentials": "wallet_issue_credentials", "wallet_view_presentations": "wallet_view_presentations" } } }
- curl
- http
- CURL
curl -L 'https://tsg.dataspac.es/api/management/signature/sign' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"type": {
"type": "JsonWebSignature2020"
},
"plainDocument": {
"id": "document1",
"content": "This is a sample document"
},
"keyId": "did:example:12345",
"normalization": "RDFC",
"proofPurpose": "assertionMethod",
"options": {
"created": "2023-10-12T18:25:43.511Z",
"proofPurpose": "assertionMethod"
},
"embeddedVerificationMethod": false
}'