Get User Email Preferences
OVERVIEW
Overview
Get the Email Preferences of a user from Publisher
This API call is used to retrieve the email preferences of a particular user from the system. The user identifier is the user id of the user or their email address.
Since v4.6
HTTP Request
GET /api/2/users/<ID>/emailpreferences
OR
GET /api/2/users/<EMAIL>/emailpreferences
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the user |
The email address of the user |
HTTP Headers
HTTP Request Header | Description | Example |
---|---|---|
Authorization | The API Authorisation token. | "Bearer XXXXXXXXXXXXX" |
Accept |
The format of the expected response.
If no parameter is set, JSON is the default response given. |
"application/xml" |
Content-Type |
The format of the provided content.
If no parameter is set, JSON is the expected content by default. |
"application/json" |
HTTP Response
Success
HTTP response 200 with Email Preferences object
(Example below)
Error
Example HTTP Request & Response
GET
http://example.com/context/api/2/users/3/emailpreferences
JSON Response
{
"emailpreferences": {
"userid": 3,
"frequency": "Daily",
"metadatanodes": [
{
"node": "Countries",
"metadata": [
"Algeria",
"Angola",
"Benin",
....
]
},
{
"node": "American States",
"metadata": [
"Alabama",
"Alaska",
"Arizona",
....
]
}
],
"modules": [
{
"name": "Publications",
"preference": "Include"
},
{
"name": "Events",
"preference": "Off"
},
{
"name": "News",
"preference": "Custom",
"frequency": "Weekly",
"metadatanodes": [
{
"node": "Countries",
"metadata": [
"Algeria",
"Angola",
"Benin",
....
]
},
{
"node": "American States",
"metadata": [
"Alabama",
"Alaska",
"Arizona",
....
]
}
]
}
],
"alertservices": [
{
"name": "Email alert ABC",
"preference": "On"
},
{
"name": "Email alert XYZ",
"preference": "Off"
}
]
}
}
XML Response
<emailpreferences>
<userid>3</userid>
<frequency>Daily</frequency>
<metadatanodes>
<metadatanode>
<node>Countries</node>
<metadata>Algeria</metadata>
<metadata>Angola</metadata>
<metadata>Benin</metadata>
<metadata>...</metadata>
</metadatanode>
<metadatanode>
<node>American States</node>
<metadata>Alabama</metadata>
<metadata>Alaska</metadata>
<metadata>Arizona</metadata>
<metadata>...</metadata>
</metadatanode>
</metadatanodes>
<modules>
<module>
<name>Publications</name>
<preference>Include</preference>
</module>
<module>
<name>Events</name>
<preference>Off</preference>
</module>
<module>
<name>News</name>
<preference>Custom</preference>
<frequency>Weekly</frequency>
<metadatanodes>
<metadatanode>
<node>Countries</node>
<metadata>Algeria</metadata>
<metadata>Angola</metadata>
<metadata>Benin</metadata>
<metadata>...</metadata>
</metadatanode>
<metadatanode>
<node>American States</node>
<metadata>Alabama</metadata>
<metadata>Alaska</metadata>
<metadata>Arizona</metadata>
<metadata>...</metadata>
</metadatanode>
</metadatanodes>
</module>
</modules>
<alertservices>
<alertservice>
<name>Email alert ABC</name>
<preference>On</preference>
</alertservice>
<alertservice>
<name>Email alert XYZ</name>
<preference>Off</preference>
</alertservice>
</alertservices>
</emailpreferences>
Comments
0 Comments