You need to be logged in into Platform of Trust Sandbox and get your bearer token to execute the following cURL requests.
curl -i -X POST \
--url "https://api-sandbox.oftrust.net/messages/v1" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9eyJzY29w...DVs5aaf" \
--header "Content-Type: application/json" \
--data \
"{
\"toIdentity\": \"0920a84a-1548-4644-b95d-e3f80e1b9ca6\",
\"subject\": \"Go to the grocery store\",
\"content\": \"Remember to buy milk!\",
\"cc\": [
\"323bde80-4cc2-472e-bb77-e6a3e95a1253\",
\"0827e9c3-9664-479f-b0ec-956a35d72e4b\"
]
}"
GET a message with its {id}
curl -i -X GET \
--url "https://api-sandbox.oftrust.net/messages/v1/{id}" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9eyJzY29w...DVs5aaf"
POST request to mark a message "read" by the current user
curl -i -X POST \
--url "https://api-sandbox.oftrust.net/messages/v1/{id}/read" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9eyJzY29w...DVs5aaf"
GET messages sent to an identity with {to_identity_id}
curl -i -X GET \
--url "https://api-sandbox.oftrust.net/messages/v1/{to_identity_id}/list" \
--header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9eyJzY29w...DVs5aaf"
NOTE: checkout doc.oftrust.net to see more requests to the Message API and code samples in Java, Python and JavaScript.