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).

GET /2/notifications/get-range-notifications

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 1 min: 1
quantity query 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)

Example

Request
GET /2/notifications/get-range-notifications
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" : "andrea.rossi",
  "job_id" : "...",
  "job_name" : "...",
  "service_name" : "...",
  "status" : "DELETED",
  "status_message" : "...",
  "runningJob" : {
    "jobId" : "...",
    "status" : "TIMED_OUT",
    "jobName" : "...",
    "serviceName" : "...",
    "message" : "..."
  }
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...