API Documentation
Toggle TOC panel
<access-service>/api/v1/users/me/notifications/email

URL structure

1 https://access-service.xy-company.com/api/v1/users/me/notifications/email

Supported methods and overview

Note: The GET method takes no parameters.

Detailed description

This API endpoint serves a number of purposes:

  • Retrieves information about the notification preferences of a Cocoon Data user (whose access token is submitted in the request to this endpoint). These notifications relate to the frequency with which this Cocoon Data user receives email notifications about items which have been shared with them.
  • Modifies the notification preferences of a Cocoon Data user (whose access token is submitted in the request to this endpoint).
    Note: These settings can also be modified through the My Account feature of SafeShare for Web.

Supported roles

This API endpoint supports requests utilizing Cocoon Data user accounts with the following roles (as described in the Organisation Administrator's Guide) and conditions:

The Cocoon Data Platform's resources available to a Cocoon Data user meeting the criteria above is determined by the access token submitted in the header of requests to this endpoint.

Required headers

The appropriate access token as the Bearer token:

  • Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...

The following header is required if the body of the request has a JSON object:

  • Content-Type: application/json

Required PUT-request parameters

The following parameters must be sent in the body of the PUT request, each as individual members of a JSON object:

  • code - Specify the enumeration (enum) value:
    • ITEM - Sets the Cocoon Data user (whose access token is submitted in the request to this endpoint) to receive email notifications (entitled 'New items have been shared with you') each time an item is shared with them. These email notifications contain links to the items (which had been shared with this user since their previous such notification), that opens the items in SafeShare for Web. Bear in mind that multiple items may appear as a 'digest' in a single email notification based on the Item shared noticication frequency in minutues property configured by a SafeShare administrator (described in the SafeShare Administrator's Guide).
    • DAILY - Sets this Cocoon Data user to receive a 'New items have been shared with you' email notification once a day, containing a digest of all items which had been shared with them since their previous such notification.
    • WEEKLY - Sets this user to receive a 'New items have been shared with you' email notification once a week, containing a digest of all items which had been shared with them since their previous such notification.
    • NONE - Sets this user to receive no 'New items have been shared with you' email notifications.
    Example (request):
    {
    "code": "DAILY"
    }

Returns

If the request succeeded, then an HTTP response status 200 OK is returned.

For successful requests only, a JSON-formatted response containing the following members is also returned:

  • notificationPreferences - An array containing information about each available notification preference in the response to this endpoint. Each element of this array contains information about one of these notification preferences, represented as an object containing the following members.
    • name - The name of the notification preference as it is exposed through the user interface of SafeShare applications.
    • code - The value of the notification preference as it is hard-coded in the Cocoon Data Platform. Each of these are equivalent to the enum value specified in the request to this endpoint.
    • selected - A boolean value representing whether (true) or not (false) the notification preference is currently set for the Cocoon Data user (whose access token is submitted in the request to this endpoint). From PUT requests to this endpoint, this value should be true for the notification preference specified in the request to this endpoint (and false for the others).
    Example (response):
    {
    "notificationPreferences": [{
    "name": "Per Item",
    "code": "ITEM",
    "selected": true
    }, {
    "name": "Daily",
    "code": "DAILY",
    "selected": false
    }, {
    "name": "Weekly",
    "code": "WEEKLY",
    "selected": false
    }, {
    "name": "None",
    "code": "NONE",
    "selected": false
    }]
    }