Skip to content

User Notification

Borja Gorriz edited this page Oct 15, 2013 · 8 revisions

Base URL: api/dime/rest/{hoster}/usernotification

Method Path Description
GET @me/@all?from={from-date}&to={to-date}&limit={max-results}&page={page-num} Returns a collection of all (read and unread) usernotifications the user has.
GET @me/unread?limit={max-results}&page={page-num} Returns a collection of UnRead usernotifications the user has.
GET @me/{Unid} Returns a specific usernotification.
POST @me/{Unid} Updates a specific usernotification.
DELETE @me/{Unid} Deletes a specific usernotification

Parameters:

  • Unid: id of a usernotification
  • from-date: limit date of oldest notifications (0 means from origin) [optional - default 0]
  • to-date: limit date of newest notifications (0 means to right now) [optional - default 0]
  • max-results: max number of results (0 or empty means all) [optional - default 0]
  • page-num: page number, each page contains “max-results” number of results (0 is first page) [optional - default 0]

Example:

@me/@all

  • Call: api/dime/rest/5b223cde-07e5-4987-b531-231876fa7601/usernotification/@me/@all
  • Response:
{
    "response": {
        "meta": {
            "v": "1.0",
            "status": "OK",
            "code": 200,
            "timeRef": 1366033798903,
            "msg": "OK"
        },
        "data": {
            "startIndex": 0,
            "itemsPerPage": 1,
            "totalResults": 1,
            "entry": [
                {

         "guid":"186c569e-9cdf-487d-ac81-650b2a828933",
         "type":"usernotification",
         "imageUrl":"",
         "created":1338824999,
         "lastUpdated":1338824999,
         "name":"text that is shown in notification bar; less then 10 chars",
         "userId":"@me",
         "read":true/false, //read by the user
         "unType":"one of the types specified below",
         "unEntry":{
               //type specific object
         }
       }
     ]
   }
  }
}

type specific payload

merge_recommendation

{
         //[..]   //general fields as specified in _general user notification body_
         "unType":"merge_recommendation",
         "unEntry":{
              "sourceId":"<personid1>",
              "sourceName":"<personName1>",
              "targetId":"<personid2>",
              "targetName":"<personName2>",
              "similarity":<number>,
              "status":"accepted/dismissed/pending"

              
         }
}

situation_recommendation

{
         //[..]   //general fields as specified in _general user notification body_
         "unType":"situation_recommendation",
         "unEntry":{
              "guid": "urn:uuid:72ccf1a0-c9df-11e2-8b8b-0800200c9a66" // situation URI
              "nao:score": 0.4581 // similarity score (float [0,1])
         }
}

adhoc_group_recommendation

{
         //[..]   //general fields as specified in _general user notification body_
         "unType":"adhoc_group_recommendation",
         "unEntry":{
              // Proposal by TI, to be checked by NUIG
              "guid":"",  //guid of the created ad-hoc group
              "nao:creator": "urn:auto-generated",
              "name": "" // group name
         }
}

Clone this wiki locally