URL structure
Supported methods and overview
GET- retrieves information about the notification preferences of a Cocoon Data user (whose access token is submitted in the request to this endpoint).PUT- modifies the notification preferences for a Cocoon Data user (whose access token is submitted in the request to this endpoint).
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 utilising 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 theBearer token:
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE0NjcwMTY2NjYsInVzZXJfbmFtZSI6ImFsZXgub...
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 notification frequency in minutes 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.
Returns
If the request succeeded, then an HTTP response status200 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). FromPUTrequests to this endpoint, this value should betruefor the notification preference specified in the request to this endpoint (andfalsefor the others).

