Get subscriptions

get

/rest/ofscCore/v1/events/subscriptions

This operation retrieves a list of subscriptions.

Request

Query Parameters
  • Contains one of the following values: true or false.
    • If true, all subscriptions in the Oracle Field Service Cloud application are returned, even if the subscriptions are created by other applications.
    • If false, then only the subscriptions created by other applications are returned.

    The default value is false.

Back to Top

Response

Supported Media Types

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : Subscription
Type: object
Title: Subscription
The array of subscriptions.
Show Source
Match All
Show Source
  • Subscription
    Title: Subscription
    The schema of the response body object for this operation.
Nested Schema : Subscription
Type: object
Title: Subscription
The schema of the response body object for this operation.
Show Source
  • List of events
    Title: List of events
    The list of subscribed events.

    The following events are supported: activityCreated, activityUpdated, activityStarted, activitySuspended, activityCompleted, activityNotDone, activityCanceled, activityDeleted, activityDelayed, activityReopened, activityPreworkCreated, activityLinkCreated, activityLinkDeleted, resourcePreferenceCreated, resourcePreferenceDeleted, requiredInventoryCreated, requiredInventoryUpdated, requiredInventoryDeleted, inventoryInstalled, inventoryDeinstalled, customerInventoryCreated, customerInventoryUpdated, customerInventoryDeleted, inventoryUndoInstall, inventoryUndoDeinstall, activityMoved, routeCreated, routeUpdated, routeActivated, routeDeactivated, routeReactivated, customerRequestCreated, inventoryRequestCreated, resourceRequestCreated, chatMessageSent, chatUpdated, broadcastStatusUpdate, transactionUpdated, userCreated, userUpdated, userDeleted, resourceCreated, resourceUpdated, routingRun, formSubmitted.

  • Subscription Config
    Title: Subscription Config
    The list of subscription config elements used to filter the required events.
  • Title: Subscription Title
    Minimum Length: 1
    Maximum Length: 255
    The title of the subscription. It can be used to distinguish a specific subscription from the other subscriptions. The field is optional and need not be unique.
Nested Schema : List of events
Type: array
Title: List of events
The list of subscribed events.

The following events are supported: activityCreated, activityUpdated, activityStarted, activitySuspended, activityCompleted, activityNotDone, activityCanceled, activityDeleted, activityDelayed, activityReopened, activityPreworkCreated, activityLinkCreated, activityLinkDeleted, resourcePreferenceCreated, resourcePreferenceDeleted, requiredInventoryCreated, requiredInventoryUpdated, requiredInventoryDeleted, inventoryInstalled, inventoryDeinstalled, customerInventoryCreated, customerInventoryUpdated, customerInventoryDeleted, inventoryUndoInstall, inventoryUndoDeinstall, activityMoved, routeCreated, routeUpdated, routeActivated, routeDeactivated, routeReactivated, customerRequestCreated, inventoryRequestCreated, resourceRequestCreated, chatMessageSent, chatUpdated, broadcastStatusUpdate, transactionUpdated, userCreated, userUpdated, userDeleted, resourceCreated, resourceUpdated, routingRun, formSubmitted.

Show Source
  • Title: Event Type
    Allowed Values: [ "activityCreated", "activityUpdated", "activityStarted", "activitySuspended", "activityCompleted", "activityNotDone", "activityCanceled", "activityDeleted", "activityDelayed", "activityReopened", "activityPreworkCreated", "activityLinkCreated", "activityLinkDeleted", "resourcePreferenceCreated", "resourcePreferenceDeleted", "requiredInventoryCreated", "requiredInventoryUpdated", "requiredInventoryDeleted", "inventoryInstalled", "inventoryDeinstalled", "customerInventoryCreated", "customerInventoryUpdated", "customerInventoryDeleted", "inventoryUndoInstall", "inventoryUndoDeinstall", "activityMoved", "routeCreated", "routeUpdated", "routeActivated", "routeDeactivated", "routeReactivated", "customerRequestCreated", "inventoryRequestCreated", "resourceRequestCreated", "chatUpdated", "chatMessageSent", "userUpdated", "userCreated", "userDeleted", "resourceUpdated", "resourceCreated", "transactionUpdated", "resourceInventoryCreated", "resourceInventoryUpdated", "resourceInventoryDeleted", "routingRun", "broadcastStatusUpdate", "formSubmitted" ]
    The type of the event.
Nested Schema : Subscription Config
Type: array
Title: Subscription Config
The list of subscription config elements used to filter the required events.
Show Source
  • Subscription Configuration Items
    Title: Subscription Configuration Items
    The array of subscription config item used to filter the events. For example, a config item can be used to filter activity events whereas another config item can be used to filter inventory events through the same subscription.
Nested Schema : Subscription Configuration Items
Type: object
Title: Subscription Configuration Items
The array of subscription config item used to filter the events. For example, a config item can be used to filter activity events whereas another config item can be used to filter inventory events through the same subscription.
Show Source
  • List of events
    Title: List of events
    The list of subscribed events.

    The following events are supported: activityCreated, activityUpdated, activityStarted, activitySuspended, activityCompleted, activityNotDone, activityCanceled, activityDeleted, activityDelayed, activityReopened, activityPreworkCreated, activityLinkCreated, activityLinkDeleted, resourcePreferenceCreated, resourcePreferenceDeleted, requiredInventoryCreated, requiredInventoryUpdated, requiredInventoryDeleted, inventoryInstalled, inventoryDeinstalled, customerInventoryCreated, customerInventoryUpdated, customerInventoryDeleted, inventoryUndoInstall, inventoryUndoDeinstall, activityMoved, routeCreated, routeUpdated, routeActivated, routeDeactivated, routeReactivated, customerRequestCreated, inventoryRequestCreated, resourceRequestCreated, chatMessageSent, chatUpdated, broadcastStatusUpdate, transactionUpdated, userCreated, userUpdated, userDeleted, resourceCreated, resourceUpdated, routingRun, formSubmitted.

  • Subscription Field List
    Title: Subscription Field List
    The list of fields and custom properties included in the event. The fields are added to the 'activityDetails' element for activity events, 'inventoryDetails' element for inventory events, and to the 'resourceDetails' element for the resource events.
    • The field names of the activity events are same as the field names retrieved from the 'Get activity' operation.
    • The field names of the inventory events are the same as the field names retrieved from the 'Get inventory' operation.
    • The field names of the resource events are the same as the field names retrieved from the 'Get resource' operation.
    • The field names of the user events are the same as the field names retrieved from the 'Get user' operation.

    Also, custom property labels can be specified along with the field names. However, the 'custom properties' parameter is optional. Therefore, if no specific fields are specified, then by default only the changed and key fields are returned.

    The following events are supported:

    • Activity events
    • Inventory events
    • Resource events
    • User events

    The 'activityDeleted' event will not contain the specified 'country_code' field and the specified custom activity properties.

  • Title: Filter Expression

    The filter expression applied to the events. Only events matching the specified filter expression are added to the subscription.

    The following events are supported:

    • All activity events
    • All inventory events
    • All resource events
    • All user events

    Filter Expression Rules

    • Filter expression is specified as a single string.
    • It should evaluate to a boolean expression.
    • It should contain 1 or more comparison statements.
    • Syntax of comparison statements: field operator value, for example,activityDetails.activityType == 'Install'.
      • The order cannot be changed. Therefore, ('Install' == activityDetails.activityType) is not valid.
      • The comparison between fields, (A == B) or between values, (1 == 1) is also not valid.
      • The field has to be an alphanumeric identifier with no spaces or special characters, except underscore. Subfields are separated by dot (.) Examples:
        • activityDetails.activityType
        • activityDetails.X_MYPROP_10
        • user
        • field.subField
      • Comparison operators:
        • <
        • >
        • <=
        • >=
        • ==
        • !=
        • in
      • Value can either be a string literal, an integer literal, or an array literal of strings and integers.
        • String literals are delimited by single quotes, with escape character ~, for example:
          • str == 'My String'
          • str == 'My string with ~' a quote inside'
        • Integer literals are without quotes, may not contain dot, or leading zeroes. For example:
          • num == 0
          • num == 12345
          • num == -67/li>
        • Array literals should only contain strings or integers and should have square brackets. Empty arrays are not allowed. Arrays are only allowed after the "in" operator.
          • enum in [1,2,3]
          • enum in ['Abc','Def','Ghi']
      • String comparisons are valid:
        • date > '2015-06-02'
      • String comparisons are case-insensitive:
        • name == 'john.smith' is the same as name == 'JOHN.SMITH'
      • String to integer coercion is valid:
        • num == -123 is the same as num == '-123'
    • Multiple comparison statements have to be separated by logical operator and/or.
      • A == 1 and B == 2 or C == 3
      • A == 'xx' or A == 'yy'
    • Operator precedence:
      1. comparison operators: ==, !=, <, >, <=, >=, in
      2. 'not'
      3. 'and', 'or'
    • Logical operators ('and' / 'or') have the same precedence, so parentheses can be used to achieve precedence.
      • A == 1 and (B == 2 or C == 3)
    • Operators are also case-insensitive:
      • (num IN [1,2,3]) OR (num < 0)
    • Any statement can be preceded by "not" operator to negate it.
      • not (activityType in ['IN','TC','BR'])
      • A == 1 and not ( B == 2 or B == 3 )
    • Whitespace outside strings is ignored.

    • When the field being compared does not exist in the event or is null, then it evaluates to empty string. For example, expressions (non_existent_field == ''), (null_field == '').

  • Subscription Monitor Changes List
    Title: Subscription Monitor Changes List
    The list of fields for which the changes need to be tracked. If the 'monitorChanges' parameter is specified, then the event is only published to the subscription, if any of the fields listed in the parameter are changed. The valid values for the field depend on the value specified in the 'events' field.
    • If the activity events are specified in the 'events' field, then only the field names of the Activity object are returned.
    • If the inventory events are specified in the 'events' field, then only the field names of the Inventory object are returned.
    • If the resource events are specified in the 'events' field, then only the field names of the Resource object are returned.
    • If the user events are specified in the 'events' field, then only the field names of the User object are returned.
    • Custom property labels can also be specified along with the field names.

    The following events are supported:

    • Activity events
    • Inventory events
    • Resource events
    • User events
Nested Schema : Subscription Field List
Type: array
Title: Subscription Field List
The list of fields and custom properties included in the event. The fields are added to the 'activityDetails' element for activity events, 'inventoryDetails' element for inventory events, and to the 'resourceDetails' element for the resource events.
  • The field names of the activity events are same as the field names retrieved from the 'Get activity' operation.
  • The field names of the inventory events are the same as the field names retrieved from the 'Get inventory' operation.
  • The field names of the resource events are the same as the field names retrieved from the 'Get resource' operation.
  • The field names of the user events are the same as the field names retrieved from the 'Get user' operation.

Also, custom property labels can be specified along with the field names. However, the 'custom properties' parameter is optional. Therefore, if no specific fields are specified, then by default only the changed and key fields are returned.

The following events are supported:

  • Activity events
  • Inventory events
  • Resource events
  • User events

The 'activityDeleted' event will not contain the specified 'country_code' field and the specified custom activity properties.

Show Source
Nested Schema : Subscription Monitor Changes List
Type: array
Title: Subscription Monitor Changes List
The list of fields for which the changes need to be tracked. If the 'monitorChanges' parameter is specified, then the event is only published to the subscription, if any of the fields listed in the parameter are changed. The valid values for the field depend on the value specified in the 'events' field.
  • If the activity events are specified in the 'events' field, then only the field names of the Activity object are returned.
  • If the inventory events are specified in the 'events' field, then only the field names of the Inventory object are returned.
  • If the resource events are specified in the 'events' field, then only the field names of the Resource object are returned.
  • If the user events are specified in the 'events' field, then only the field names of the User object are returned.
  • Custom property labels can also be specified along with the field names.

The following events are supported:

  • Activity events
  • Inventory events
  • Resource events
  • User events
Show Source
Back to Top

Examples

The following example shows how to get list of subscriptions by submitting a GET request on the REST resource.

Example of Request Header

The following shows an example of the response header.

GET /rest/ofscCore/v1/events/subscriptions
Connection: close
Accept-Encoding: gzip,deflate
Authorization: Basic bXlyb290QHFhNTUwMzox
Host: <instance_name>.etadirect.com

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 25 Apr 2016 12:36:21 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: close

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
    "items" : [
        {
            "subscriptionId" : "356a192b7913b04c54574d18c28d46e6395428ab",
            "subscriptionTitle" : "My first subscription",
            "applicationId" : "middleware1",
            "createdTime" : "2017-05-04 07:39:19",
            "expirationTime" : "2017-05-05 17:39:19",
            "subscriptionConfig" : [
                {
                    "events" : ["activityUpdated"],
                    "filterExpression" : "not (activityType in ['IN','TC','BR']) and (event.user != 'ics_integ') and customerName != ''"
                }
            ]
        },
        {
            "subscriptionId" : "da4b9237bacccdf19c0760cab7aec4a8359010b0",
            "subscriptionTitle" : "My second subscription",
            "applicationId" : "middleware1",
            "createdTime" : "2017-05-04 07:39:19",
            "expirationTime" : "2017-05-05 17:39:19",
            "subscriptionConfig" : [
                {
                    "events" : ["activityCompleted"],
                    "fields" : ["firstManualOperationUser", "endTime"]
                }
            ]
        }
    ]
}
Back to Top