Return Notifications by Query
/mobile/system/notifications/notifications/
Call this operation to retrieve 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 team member with either the Administrator
or Developer
role.
Request
-
createdOnOrAfter(optional): string
Filter by
createdOn
on or after the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
createdOnOrBefore(optional): string
Filter by
createdOn
on 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
processedOn
on or after the given UTC date/time (in YYYY-DD-MMThh:mm:ss.SSSZ format). -
processedOnOrBefore(optional): string
Filter by
processedOn
on 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=market
returns notifications withtag
equal toMarketing
,marketing
, andmarkets
. -
sendOnOrAfter(optional): string
Filter by
sendOn
on or after the given UTC date/time (in YYYY-DD-MM[Thh:mm]Z format). -
sendOnOrBefore(optional): string
Filter by
sendOn
on or before the given UTC date/time (in YYYY-DD-MM[Thh:mm]Z format). -
status(optional): string
Filter by
status
matching the given string. -
tag(optional): string
Filter by
tag
matching the given string.
Response
- application/json
200 Response
object
Notifications with paging information
-
object Notifications array
Title:
Notifications array
-
object Pagination information
Title:
Pagination information
object
Notifications array
-
items:
array Notifications
Title:
Notifications
Minimum Number of Items:0
object
Pagination information
-
object Paging properties
Title:
Paging properties
array
Notifications
0
-
[0]:
object Stored notification
Title:
Stored notification
object
Stored notification
-
object Stored notification properties
Title:
Stored notification properties
-
object User-entered notification
Title:
User-entered notification
object
Stored notification properties
-
createdOn:
string
Title:
Full date and time
Pattern:([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])Z
Complete date plus hours, minutes, seconds, and a decimal fraction of a second in W3C date-time format (YYYY-MM-DDThh:mm.ss.SSSZ). -
deviceCount:
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:
string
Message explaining a status of `Error` or `Warning`. If there are multiple associated problems, only the first is shown here.
-
id:
integer
Service-generated identifier.
-
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
-
platformCounts:
array platformCounts
Minimum Number of Items:
1
Unique Items Required:true
Device counts by platform. -
processedOn:
string
Title:
Full date and time
Pattern:([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])Z
Complete date plus hours, minutes, seconds, and a decimal fraction of a second in W3C date-time format (YYYY-MM-DDThh:mm.ss.SSSZ). -
status:
string
Title:
Status values
Allowed Values:[ "New", "Scheduled", "Sending", "Error", "Warning", "Sent" ]
object
User-entered notification
-
object Notification properties
Title:
Notification properties
-
object Notification payload
Title:
Notification payload
The 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). The maximum payload size dependes on the provider. For APNS and FCM, the payload size limit is 4096 bytes, for WNS the limit is 5000 bytes, and for Syniverse the limit is 1000 bytes.
array
Relationship links
1
true
-
[0]:
object Link
Title:
Link
array
1
true
-
[0]:
object Device counts for a platform
Title:
Device counts for a platform
object
Link
-
href:
string
A relative URL.
-
rel:
Allowed Values:
[ "self", "canonical", "prev", "next" ]
The type of link.
object
Device counts for a platform
-
deviceCount:
integer
How many devices were selected for this platform.
-
platform:
string
Title:
Supported platforms
Allowed Values:[ "IOS", "ANDROID", "WINDOWS", "WEB" ]
-
successCount:
integer
How many devices were accepted by the underlying notification provider.
object
Notification properties
-
notificationTokens:
array notificationTokens
Minimum Number of Items:
1
Maximum Number of Items:1000
Unique Items Required:true
Select devices to send the notification to by `notificationToken`. -
platform:
string
Title:
Supported platforms
Allowed Values:[ "IOS", "ANDROID", "WINDOWS", "WEB" ]
-
provider:
string
Title:
Supported notification providers. Support for GCM is deprecated. You should upgrade all GCM applications to FCM.
Allowed Values:[ "APNS", "GCM", "FCM", "WNS", "SYNIVERSE" ]
-
sendOn:
string
Title:
Short date and time
Pattern:([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]))+Z
Complete date plus hours and minutes in W3C date-time format (YYYY-MM-DD[Thh:mm]Z). -
tag:
string
User-defined tag that you use to categorize notifications.
-
users:
array users
Minimum Number of Items:
1
Unique Items Required:true
Select devices to send the notification to by `user`.
object
Notification payload
-
message:
string
A simple message string. This will be used to create the payload. The maximum payload size depends on the provider. For APNS and FCM, the payload size limit is 4096 bytes, for WNS the limit is 5000 bytes, and for Syniverse the limit is 1000 bytes.
-
payload:
object Unified payload for notification providers
Title:
Unified payload for notification providers
-
template:
object Template reference
Title:
Template reference
Name and parameters for a template from which to create the payload
array
1
1000
true
array
1
true
object
Unified payload for notification providers
-
services:
object Notification payloads for specific providers
Title:
Notification payloads for specific providers
object
Template reference
-
name:
string
The template name.
-
parameters:
object parameters
The template parameters. The required parameters are defined by the template.
object
Notification payloads for specific providers
-
apns:
object apns
If specified, this payload is used for notifications sent using APNS. This object must conform to APNS requirements.
-
fcm:
object fcm
If specified, this payload is used for notifications sent using FCM. This object can contain arbitrary JSON properties.
-
gcm:
object gcm
Deprecated. You should upgrade all GCM applications to FCM.
-
syniverse:
object Syniverse payload
Title:
Syniverse payload
-
wns:
object WNS payload
Title:
WNS payload
object
object
object
object
Syniverse payload
-
body:
string
The message to send as an SMS message.
object
WNS payload
-
badge:
object Badge value or glyph
Title:
Badge value or glyph
-
raw:
object Raw payload
Title:
Raw payload
Specifies a raw payload. This is any arbitrary JSON object. -
tile:
object Base tile element
Title:
Base tile element
Base tile element, which contains a single visual element. -
toast:
object Base toast element
Title:
Base toast element
Base toast element, which contains at least a single visual element.
object
Badge value or glyph
-
value:
string
Either a numeric value or a string value that specifies a predefined badge glyph.
-
version:
integer
The version of the badge XML schema that this particular payload was developed for.
object
Raw payload
object
Base tile element
-
visual:
object Binding child elements
Title:
Binding child elements
object
Base toast element
-
audio:
object Sound to play
Title:
Sound to play
Specifies a sound to play when a toast is displayed. This element also allows you to mute toast audio. -
commands:
object Scenario commands
Title:
Scenario commands
Specifies that the toast indicates an incoming call or an alarm, with appropriate commands associated with each scenario. -
duration:
string
The amount of time the toast should display.
-
launch:
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
object
Binding child elements
-
object Child element properties
Title:
Child element properties
-
object Common visual and binding properties
Title:
Common visual and binding properties
object
Child element properties
-
binding:
array binding
Minimum Number of Items:
1
Maximum Number of Items:2
Specifies the tile template. Every notification should include one binding element for each supported tile size. -
contentId:
string
Set to a sender-defined string that uniquely identifies the content of the notification.
-
version:
string
The version of the tile XML schema this particular payload was developed for.
object
Common visual and binding properties
-
addImageQuery:
boolean
Set to `true` to allow Windows to append a query string to the image URI supplied in the toast notification.
-
baseUri:
string
A default base URI that is combined with relative URIs in image source attributes.
-
branding:
string
The form that the tile should use to display the app's brand.
-
lang:
string
The target locale of the XML payload, specified as a BCP-47 language tag such as `en-US` or `fr-FR`.
array
1
2
-
[0]:
object Toast template
Title:
Toast template
object
Toast template
-
object Toast template properties
Title:
Toast template properties
-
object Common visual and binding properties
Title:
Common visual and binding properties
object
Toast template properties
-
fallback:
string
For backward compatibility, a template to use if the primary template isn't found.
-
image:
array image
Minimum Number of Items:
0
Specifies an image to use in the toast template. -
template:
string
One of the provided templates on which to base the toast.
-
text:
array text
Minimum Number of Items:
1
Specifies text to use in the toast template.
array
0
-
[0]:
object Image to use in a toast or tile template
Title:
Image to use in a toast or tile template
array
1
object
Image to use in a toast or tile template
-
addImageQuery:
boolean
Set to `true` to allow Windows to append a query string to the image URI supplied in the toast.
-
alt:
string
For users of assistive technologies, a description of the image.
-
src:
string
The URI of the image source.
object
Sound to play
-
loop:
boolean
Set to `true` if the sound should repeat as long as the toast is shown, and `false` to play only once.
-
silent:
boolean
Set to `true` to mute the sound, and `false` to allow the toast sound to play.
-
src:
string
The media file to play in place of the default sound.
object
Scenario commands
-
commands:
array commands
Minimum Number of Items:
1
Specifies the scenario-associated buttons shown in the toast. -
scenario:
string
Specifies the intended use of the notification.
object
Single binding element that defines a toast
-
object Element properties
Title:
Element properties
-
object Common visual and binding properties
Title:
Common visual and binding properties
array
1
-
[0]:
object Scenario button
Title:
Scenario button
Specifies a scenario-associated button shown in a toast. The scenario is specified in the parent commands element.
object
Scenario button
-
arguments:
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.
object
Element properties
-
binding:
object Toast template
Title:
Toast template
-
version:
string
The version of the toast XML schema that this particular payload was developed for.
object
object
Paging properties
-
count:
integer
The number of items returned.
-
hasMore:
boolean
Set to `true` when there are subsequent elements in the collection.
-
links:
array Relationship links
Title:
Relationship links
Minimum Number of Items:1
Unique Items Required:true
{
"hasMore":false,
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications?offset=0&limit=2"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications?offset=0&limit=1000"
}
],
"items":[
{
"notificationTokens":[
"APNSdeviceToken"
],
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications/1234"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications/1234"
}
],
"id":1234,
"tag":"Marketing",
"message":"This is the alert message.",
"createdOn":"2014-04-02T12:34:56.789Z",
"status":"New"
},
{
"platformCounts":[
{
"deviceCount":1,
"successCount":1,
"platform":"IOS"
}
],
"processedOn":"2014-04-01T12:34:56.789Z",
"notificationTokens":[
"APNSdeviceToken"
],
"links":[
{
"rel":"canonical",
"href":"/mobile/system/notifications/notifications/1235"
},
{
"rel":"self",
"href":"/mobile/system/notifications/notifications/1235"
}
],
"id":1235,
"tag":"System",
"message":"Update required.",
"createdOn":"2014-04-03T58:24:12.345Z",
"status":"Sent"
}
]
}
400 Response
object
Error
-
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
The service's error code.
-
o:errorDetails:
array o:errorDetails
Minimum Number of Items:
0
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.
array
0
-
[0]:
object Error Detail
Title:
Error Detail
object
Error Detail
-
instance:
string
URI to the link that provides more detailed information about the error.
-
o:errorCode:
string
The service's 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" } ] }