Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Table of Contents

List Messages

Current Implementation

Retrieves the messages of a particular User. Messages can be retrieved from different sources. Currently supported sources are: Email, Alert , ParameterizedAlert, or Document.

To get a better understanding on how Parameterized Alerts are retrieved, take a look at the following document: Alerts and Notifications#AlertRetrieval

Parameters

Base URL: /getMessages

Parameters:

NameTypeMandatoryDescription
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
typeENUMNo

Possible values: ['ALL', 'ALERT', 'EMAIL', 'DOCUMENT',"PARAMETERIZEDALERT' ].

Default value: "ALL".

The source of the messages.

locationENUMNo

Possible values: ['INBOX', 'SENT', 'ARCHIVE'].

Default value: "INBOX".

patientIdStringNoUsed if we want to retrieve only those messages related to a specific patient.

API Sample

curl 'http://192.168.1.122:8080/PresentationServices/getMessages?userId=QA_1&token=a3fef5d8-951a-4a11-9b39-7efb63695211&type=PARAMETERIZEDALERT' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed

Result
{

"messagesFact": {

"statusFact": {

"success": true

}

,"messageObjects": [

{

  "messageId": "ff80818147e7ee6c0147e7f14d000005",
  "type": "ParameterizedAlert",
  "podId": "Pod A",
  "location": "INBOX",
  "labels": [],
  "messageDate": "8/18/14",
  "messageTime": "09:07",
  "description": "Skin To Skin Alert",
  "title": "            peggy 500##split##33wks 999g",
  "payload": "This patient has not had skin to skin contact for at least 7 consecutive days.",
  "status": "Unread",
  "priority": "HIGH",
  "tasksCount": 0,
  "tasksComplete": 0
},{
  "messageId": "22",
  ...
  }
 ]}}

Set Messages

Current Implementation

This operation is used to change the status of one or more messages.

This is a POST operation!

Parameters

Base URL: /setMessages

Parameters:

NameTypeMandatoryDescription
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
actionENUMYesPossible values: ['Read', 'Unread', 'Archive', 'Delete']
This is the action we want to execute agains the message 
messageIdsStringYesThe id of the message you want to execute the action against. You could include this parameter multiple times to work on multiple messages at once.
locationENUMYes

Possible values: ['INBOX', 'SENT', 'ARCHIVE'].

Default value: "INBOX".

typesENUMYes

Possible values: ['ALL', 'ALERT', 'EMAIL', 'DOCUMENT',"PARAMETERIZEDALERT' ].

Default value: "ALL".

API Sample

curl 'http://192.168.2.109:8080/PresentationServices/setMessages' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Origin: file://' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; Nexus 5 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'action=Read&messageIds=ff80818147fd49740147fd55b2e40002&location=INBOX&types=ParameterizedAlert&userId=sigal&token=481fe6f1-c7a5-4d94-8b5b-7c0bec3d2aed' --compressed

Result
{
"messagesFact": {
"statusFact": {
"success": true,
"failMessage": "Set Messages successful"
}
}
}
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.