Messaging
Operations about DIDComm messaging. DIDComm messages are addressed by DID using Dock's relay service.
The current most common use case for the messaging service is to send credentials and presentation requests to the Truvera Wallet, but other clients can use it too.
Encrypt Message
In most cases you'll want to ensure the privacy of the message by encrypting it before sending.
Parameters
body
body
object
true
The recipients, sender and message
» type
body
string
false
none
» payload
body
object
true
none
» senderDid
body
string
true
none
» algorithm
body
string
false
none
» recipientDids
body
[oneOf]
true
none
Enumerated Values
» algorithm
ECDH-1PU+A256KW
» algorithm
ECDH-ES+A256KW
Messaging encrypt
ECDH-1PU+A256KW
Possible values: POST /messaging/encrypt HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 102
{
"type": "text",
"payload": {},
"senderDid": "text",
"algorithm": "ECDH-1PU+A256KW",
"recipientDids": [
"text"
]
}
{
"code": 1
}
Decrypt Message
Parameters
body
body
object
true
The JWM
» jwe
body
object
true
none
Decrypts a JSON Web Message
POST /messaging/decrypt HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 10
{
"jwe": {}
}
{
"code": 1
}
Signing Messages
Signing a message helps to prove to the recipient that the message is valid and unaltered. The message will be signed as a Base64 encoded JWT.
Parameters
body
body
object
true
The message payload
» payload
body
object
true
none
» senderDid
body
string
true
none
» type
body
string
false
none
Signs a DIDComm message as a base64 encoded JWT
POST /messaging/sign HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"payload": {},
"senderDid": "text",
"type": "text"
}
{
"code": 1
}
Verifying a Message
Verify that the message is valid.
Parameters
body
body
object
true
The message payload
» jws
body
string
true
none
Verifies a JWS in its compacted form
POST /messaging/verify HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 14
{
"jws": "text"
}
{
"code": 1
}
Send Message
Sends a DIDComm message using our relay service and DID service endpoints, it also returns a URL for QR code scanning. Supports encrypted, plaintext and signed DIDComm messages. You can generate an encrypted DIDComm message by calling the /messaging/encrypt
route.
The typ
attribute must be a DIDComm type (i.e. starts with "application/didcomm").
Parameters
body
body
object
true
The message payload
» to
body
string
true
none
» message
body
Message
true
none
Sends a DIDComm message using our relay service and DID service endpoints, it also returns a URL for QR code scanning. Supports encrypted, plaintext and signed DIDComm messages. You can generate an encrypted DIDComm message by calling the /messaging/encrypt route
POST /messaging/send HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26
{
"to": "text",
"message": {}
}
{
"code": 1
}
Last updated
Was this helpful?