D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

Notifications Resource

REST interface for the social networking library (notifications).

POST /2/notifications/catalogue

Send a Catalogue notification to a given user

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Content-Type header application/json
Request Body
media type data type
application/json CatalogueEvent (JSON)
Response Codes
code condition
200 Catalogue Notification is sent correctly
500 The error is reported into the 'message' field of the returned object
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /2/notifications/catalogue
Content-Type: application/json
Accept: application/json
Authorization: ...

                
{
  "idsToNotify" : [ "...", "..." ],
  "itemId" : "...",
  "notifyText" : "...",
  "itemURL" : "...",
  "idsAsGroup" : true,
  "type" : "ITEM_UPDATED"
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /2/notifications/get-range-notifications

Retrieve notifications of the token's owner

Request Parameters
name type description default constraints
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources    
Content-Type header application/json    
from query must be greater or equal to 1, range[0, infinity] 1 min: 1
quantity query quantity must be greater or equal to 0 10 min: 0
Response Codes
code condition
200 Notifications retrieved and reported in the 'result' field of the returned object
500 The error is reported into the 'message' field of the returned object
Response Body
media type data type description
application/json object (JSON) notifications up to quantity

Example

Request
GET /2/notifications/get-range-notifications
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /2/notifications/is-user-disabled

Return whether the notifications for this user are enabled or not

Request Parameters
name type description constraints
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources  
Content-Type header application/json  
username query the username you want to check required
Response Codes
code condition
200 true if the notification for the username given as query param are disabled (Catalogue and Workspace ones), false otherwise
500 The error is reported into the 'message' field of the returned object
Response Body
media type data type description
application/json object (JSON) true if the notification for the user are disabled (Catalogue and Workspace ones)

Example

Request
GET /is-user-disabled?username=john.smith
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /2/notifications/notify-job-status

Send a JOB notification to a given recipient

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Content-Type header application/json
Request Body
media type data type description
application/json JobNotificationBean (JSON) The job bean
Response Codes
code condition
200 Notification is sent correctly
500 The error is reported into the 'message' field of the returned object
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /2/notifications/notify-job-status
Content-Type: application/json
Accept: application/json
Authorization: ...

                
{
  "recipient" : "...",
  "job_id" : "...",
  "job_name" : "...",
  "service_name" : "...",
  "status" : "EXECUTING",
  "status_message" : "..."
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /2/notifications/workspace

Send a Workspace notification to a given user

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Content-Type header application/json
Request Body
media type data type
application/json WorkspaceEvent (JSON)
Response Codes
code condition
200 Workspace Notification is sent correctly
500 The error is reported into the 'message' field of the returned object
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /2/notifications/workspace
Content-Type: application/json
Accept: application/json
Authorization: ...

                
{
  "type" : "...",
  "idsToNotify" : [ "...", "..." ],
  "idsAsGroup" : true
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...