Return Notifications by Query
/mobile/system/notifications/notifications/
Retrieves the notifications that match the query parameters. Only notifications that match ALL specific query parameters are returned.
If you are using BASIC authorization, and the notifications are for a different mobile backend, then the Oracle-Mobile-Backend-ID header must identify that mobile backend, and not the backend that your app is associated with.
Permissions
To access this operation, you must be a team member with the MobileEnvironment_Notifications role.
Request
-
createdOnOrAfter(optional): string
Filter by
createdOnon or after the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
createdOnOrBefore(optional): string
Filter by
createdOnon or before the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
limit(optional): integer
Maximum number of items to be returned. If the requested limit is too large, then a lower limit is substituted.
-
offset(optional): integer
The zero-based index of the first item to return.
-
orderBy(optional): string
Specify the ordering for the query operations. The default sort order is ascending by ID. When using ordering with paging, the next and previous links MUST respect the ordering. The format is: "orderBy" "=" 1#( attr [ ":" "asc" | "desc" ] ), where 'attr' parameter may contain any attribute of entity [ "id" | "status" | "tag" | "platform" | "sendOn" | "createdOn" | "processedOn" ].
-
processedOnOrAfter(optional): string
Filter by
processedOnon or after the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
processedOnOrBefore(optional): string
Filter by
processedOnon or before the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
q(optional): string
Filter results based on a case-insensitive partial match of this string with the
tag. For example,q=marketreturns notifications withtagequal toMarketing,marketing, andmarkets. -
sendOnOrAfter(optional): string
Filter by
sendOnon or after the given UTC date/time (in YYYY-DD-MM[Thh:mm]Z format). -
sendOnOrBefore(optional): string
Filter by
sendOnon or before the given UTC date/time (in YYYY-DD-MM[Thh:mm]Z format). -
status(optional): string
Filter by
statusmatching the given string. -
tag(optional): string
Filter by
tagmatching the given string.
Response
- application/json
200 Response
objectNotifications with paging information-
object Notifications array
Title:
Notifications array -
object Pagination information
Title:
Pagination information
objectNotifications array-
items(optional):
array Notifications
Title:
NotificationsMinimum Number of Items:0
objectPagination information-
object Paging properties
Title:
Paging properties
arrayNotifications0-
Array of:
object Stored notification
Title:
Stored notification
objectStored notification-
object Stored notification properties
Title:
Stored notification properties -
object User-entered notification
Title:
User-entered notification
objectStored notification properties-
createdOn(optional):
string
Title:
Full date and timePattern:([0-9][0-9][0-9][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]).([0-9][0-9][0-9])ZComplete date plus hours, minutes, seconds, and a decimal fraction of a second in W3C date-time format (YYYY-MM-DDThh:mm.ss.SSSZ). -
deviceCount(optional):
integer
When the `status` is `Sending`, `Sent`, or `Warning`, this is the number of devices that this notification was sent to. Also, under some conditions, this attribute is included when the `status` is `Error`.
-
errorMessage(optional):
string
Message explaining a status of `Error` or `Warning`. If there are multiple associated problems, only the first is shown here.
-
id(optional):
integer
Service-generated identifier.
-
links(optional):
array Relationship links
Title:
Relationship linksMinimum Number of Items:1Unique Items Required:true -
platformCounts(optional):
array platformCounts
Minimum Number of Items:
1Unique Items Required:trueDevice counts by platform. -
processedOn(optional):
string
Title:
Full date and timePattern:([0-9][0-9][0-9][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]).([0-9][0-9][0-9])ZComplete date plus hours, minutes, seconds, and a decimal fraction of a second in W3C date-time format (YYYY-MM-DDThh:mm.ss.SSSZ). -
status(optional):
string
Title:
Status valuesAllowed Values:[ "New", "Scheduled", "Sending", "Error", "Warning", "Sent" ]
objectUser-entered notification-
object Notification properties
Title:
Notification properties -
object Notification payload
Title:
Notification payloadThe payload to send. A notification can specify any combination of message, template, and unified payload. When selecting the most appropriate payload for a provider, the service uses the unified payload if it exists, then the template, if it exists, then the message (in that order).
arrayRelationship links1true-
Array of:
object Link
Title:
Link
array1true-
Array of:
object Device counts for a platform
Title:
Device counts for a platform
objectLink-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]The type of link.
objectDevice counts for a platform-
deviceCount:
integer
How many devices were selected for this platform.
-
platform:
string
Title:
Supported platformsAllowed Values:[ "IOS", "ANDROID", "WINDOWS", "WEB" ] -
successCount:
integer
How many devices were accepted by the underlying notification provider.
objectNotification properties-
notificationTokens(optional):
array notificationTokens
Minimum Number of Items:
1Maximum Number of Items:1000Unique Items Required:trueSelect devices to send the notification to by `notificationToken`. -
platform(optional):
string
Title:
Supported platformsAllowed Values:[ "IOS", "ANDROID", "WINDOWS", "WEB" ] -
provider(optional):
string
Title:
Supported notification providersAllowed Values:[ "APNS", "GCM", "FCM", "WNS", "SYNIVERSE" ] -
sendOn(optional):
string
Title:
Short date and timePattern:([0-9][0-9][0-9][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])(T([0-1][0-9]|2[0-3]):([0-5][0-9]))+ZComplete date plus hours and minutes in W3C date-time format (YYYY-MM-DD[Thh:mm]Z). -
tag(optional):
string
User-defined tag that you use to categorize notifications.
-
users(optional):
array users
Minimum Number of Items:
1Unique Items Required:trueSelect devices to send the notification to by `user`.
objectNotification payload-
message(optional):
string
A simple message string. This will be used to create the payload. The maximum payload size depends on the provider. For APNS, FCM and GCM the payload size limit is 4096 bytes, for WNS the limit is 5000 bytes, and for Syniverse the limit is 1000 bytes.
-
payload(optional):
object Unified payload for notification providers
Title:
Unified payload for notification providers -
template(optional):
object Template reference
Title:
Template referenceName and parameters for a template from which to create the payload
array11000truearray1trueobjectUnified payload for notification providers-
services:
object Notification payloads for specific providers
Title:
Notification payloads for specific providers
objectTemplate reference-
name:
string
The template name.
-
parameters(optional):
object parameters
The template parameters. The required parameters are defined by the template.
objectNotification payloads for specific providers-
apns(optional):
object apns
If specified, this payload is used for notifications sent using APNS. This object must conform to APNS requirements.
-
fcm(optional):
object fcm
If specified, this payload is used for notifications sent using FCM. An
fcmobject can contain either anotificationobject or adataobject. Anotificationobject has a predefined set of user-visible keys described in the FCM documentation. Adataobject has custom key-value pairs. -
gcm(optional):
object gcm
If specified, this payload is used for notifications sent using GCM. This object can contain arbitrary JSON properties.
-
syniverse(optional):
object Syniverse payload
Title:
Syniverse payload -
wns(optional):
object WNS payload
Title:
WNS payload
objectobjectfcm object can contain either a notification object or a data object. A notification object has a predefined set of user-visible keys described in the FCM documentation. A data object has custom key-value pairs.objectobjectSyniverse payload-
body:
string
The message to send as an SMS message.
objectWNS payload-
badge(optional):
object Badge value or glyph
Title:
Badge value or glyph -
raw(optional):
object Raw payload
Title:
Raw payloadSpecifies a raw payload. This is any arbitrary JSON object. -
tile(optional):
object Base tile element
Title:
Base tile elementBase tile element, which contains a single visual element. -
toast(optional):
object Base toast element
Title:
Base toast elementBase toast element, which contains at least a single visual element.
objectBadge value or glyph-
value:
string
Either a numeric value or a string value that specifies a predefined badge glyph.
-
version(optional):
integer
The version of the badge XML schema that this particular payload was developed for.
objectRaw payloadobjectBase tile element-
visual:
object Binding child elements
Title:
Binding child elements
objectBase toast element-
audio(optional):
object Sound to play
Title:
Sound to playSpecifies a sound to play when a toast is displayed. This element also allows you to mute toast audio. -
commands(optional):
object Scenario commands
Title:
Scenario commandsSpecifies that the toast indicates an incoming call or an alarm, with appropriate commands associated with each scenario. -
duration(optional):
string
The amount of time the toast should display.
-
launch(optional):
string
A string that is passed to the application when it is activated by the toast. The format and contents of this string are defined by the app for its own use.
-
visual:
object Single binding element that defines a toast
Title:
Single binding element that defines a toast
objectBinding child elements-
object Child element properties
Title:
Child element properties -
object Common visual and binding properties
Title:
Common visual and binding properties
objectChild element properties-
binding(optional):
array binding
Minimum Number of Items:
1Maximum Number of Items:2Specifies the tile template. Every notification should include one binding element for each supported tile size. -
contentId(optional):
string
Set to a sender-defined string that uniquely identifies the content of the notification.
-
version(optional):
string
The version of the tile XML schema this particular payload was developed for.
objectCommon visual and binding properties-
addImageQuery(optional):
boolean
Set to `true` to allow Windows to append a query string to the image URI supplied in the toast notification.
-
baseUri(optional):
string
A default base URI that is combined with relative URIs in image source attributes.
-
branding(optional):
string
The form that the tile should use to display the app's brand.
-
lang(optional):
string
The target locale of the XML payload, specified as a BCP-47 language tag such as `en-US` or `fr-FR`.
array12-
Array of:
object Toast template
Title:
Toast template
objectToast template-
object Toast template properties
Title:
Toast template properties -
object Common visual and binding properties
Title:
Common visual and binding properties
objectToast template properties-
fallback(optional):
string
For backward compatibility, a template to use if the primary template isn't found.
-
image(optional):
array image
Minimum Number of Items:
0Specifies an image to use in the toast template. -
template(optional):
string
One of the provided templates on which to base the toast.
-
text(optional):
array text
Minimum Number of Items:
1Specifies text to use in the toast template.
array0-
Array of:
object Image to use in a toast or tile template
Title:
Image to use in a toast or tile template
array1objectImage to use in a toast or tile template-
addImageQuery(optional):
boolean
Set to `true` to allow Windows to append a query string to the image URI supplied in the toast.
-
alt(optional):
string
For users of assistive technologies, a description of the image.
-
src:
string
The URI of the image source.
objectSound to play-
loop(optional):
boolean
Set to `true` if the sound should repeat as long as the toast is shown, and `false` to play only once.
-
silent(optional):
boolean
Set to `true` to mute the sound, and `false` to allow the toast sound to play.
-
src(optional):
string
The media file to play in place of the default sound.
objectScenario commands-
commands:
array commands
Minimum Number of Items:
1Specifies the scenario-associated buttons shown in the toast. -
scenario:
string
Specifies the intended use of the notification.
objectSingle binding element that defines a toast-
object Element properties
Title:
Element properties -
object Common visual and binding properties
Title:
Common visual and binding properties
array1-
Array of:
object Scenario button
Title:
Scenario buttonSpecifies a scenario-associated button shown in a toast. The scenario is specified in the parent commands element.
objectScenario button-
arguments(optional):
string
An argument string, which can be passed to the associated app to provide the specifics about the action that it should execute in response to the user action.
-
id:
string
Specifies one command from the system-defined command list.
objectElement properties-
binding(optional):
object Toast template
Title:
Toast template -
version(optional):
string
The version of the toast XML schema that this particular payload was developed for.
objectobjectPaging properties-
count(optional):
integer
The number of items returned.
-
hasMore(optional):
boolean
Set to `true` when there are subsequent elements in the collection.
-
links(optional):
array Relationship links
Title:
Relationship linksMinimum Number of Items:1Unique Items Required:true
{
"hasMore":false,
"items":[
{
"id":1234,
"message":"This is the alert message.",
"createdOn":"2014-04-02T12:34:56.789Z",
"status":"New",
"tag":"Marketing",
"notificationTokens":[
"APNSdeviceToken"
],
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications/1234"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications/1234"
}
]
},
{
"message":"Update required.",
"id":1235,
"createdOn":"2014-04-03T58:24:12.345Z",
"platformCounts":[
{
"platform":"IOS",
"deviceCount":1,
"successCount":1
}
],
"status":"Sent",
"tag":"System",
"notificationTokens":[
"APNSdeviceToken"
],
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications/1235"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications/1235"
}
],
"processedOn":"2014-04-01T12:34:56.789Z"
}
],
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications?offset=0&limit=2"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications?offset=0&limit=1000"
}
]
}
400 Response
objectError-
detail:
string
Message that provides the error details.
-
o:ecid:
string
Execution context ID, which is a unique identifier to correlate events or requests that are associated with the same transaction across several components.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorDetails(optional):
array o:errorDetails
Minimum Number of Items:
0List of the issues that cause the error. Included when the error is caused by multiple issues. -
o:errorPath:
string
The relative point in the API path where the error occurred.
-
status:
integer
HTTP status code. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more details.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
array0-
Array of:
object Error Detail
Title:
Error Detail
objectError Detail-
instance:
string
The URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
Mobile Cloud Service error code.
-
o:errorPath:
string
The relative point in the API path where the error occurred.
-
title:
string
Summary of the problem.
-
type:
string
The URI to the link that provides details about the HTTP status code.
Examples
This example shows how to retrieve notifications by submitting a GET request on the REST resource.
curl -i \ -X GET \ -u team.user@example.com:password \ -H "Oracle-Mobile-Backend-ID: ABCD9278-091f-41aa-9cb2-184bd0586fce" \ http://fif.cloud.oracle.com/mobile/system/notifications/notifications/?orderBy=sendOn,tag
Example of Response Header
Here's an example of the response header:
200 OK Date: Tue, 23 Jun 2015 00:53:24 GMT Content-Type: application/json; charset=UTF-8
Example of Response Body
This example shows the contents of the response body in JSON format:
{
"items": [
{
"id": 4,
"message": "Reminder: Status on incident 1548 is due",
"users": [
"technician21@fif.com",
"technician14@fif.com"
],
"roles": [ ],
"notificationTokens": [ ],
"sendOn": "2015-06-25T06:00Z",
"tag": "Incidents",
"status": "Scheduled",
"createdOn": "2015-06-23T00:26:30.019Z",
"links": [
{
"rel": "canonical",
"href": "/mobile/system/notifications/notifications/4"
},
{
"rel": "self",
"href": "/mobile/system/notifications/notifications/4"
}
]
},
{
"id": 5,
"message": "Incident service will be unavailable between 1:00 a.m. and 3:00 a.m. PST",
"users": [ ],
"roles": [ ],
"notificationTokens": [ ],
"sendOn": "2015-06-25T06:00Z",
"tag": "System",
"status": "Scheduled",
"createdOn": "2015-06-23T00:27:05.175Z",
"links": [
{
"rel": "canonical",
"href": "/mobile/system/notifications/notifications/5"
},
{
"rel": "self",
"href": "/mobile/system/notifications/notifications/5"
}
]
}
],
"hasMore": false,
"limit": 2,
"count": 2,
"links": [
{
"rel": "canonical",
"href": "/mobile/system/notifications/notifications/?orderBy=sendOn%2Ctag&offset=0&limit=2"
},
{
"rel": "self",
"href": "/mobile/system/notifications/notifications/?orderBy=sendOn%2Ctag"
}
]
}