Get events

get

/rest/ofscCore/v1/events

This operation retrieves a list of events after the 'page' request parameter.

If there are no new events available, then the operation returns an empty list. If the operation returns an empty list, it is recommended that the same request is sent after 1-10 minutes, but not after 36 hours.

If the 'subscriptionId' parameter is specified, only the events matching the subscription's filter are returned.

If the client application loses the value of the 'page' parameter due to abnormal process termination, the last requested 'page' parameter can be recovered through the disaster recovery flow. For more information, see the 'Recovering lost page parameter' section under Receiving Events.

Note: Although all the request parameters are optional, you must specify either the subscription ID or the page identifier to retrieve the events for a specific subscription.

Request

Supported Media Types
Query Parameters
  • The number of items to be returned in the response. The maximum value is 1000. If a higher value is specified, then the value will be set to the maximum allowed value and the specified value is ignored.
  • The page identifier to iterate the events. The value of the parameter is set to the value of the 'nextPage' element returned by a previous call to this operation. If this parameter is not specified, then an empty response is returned along with a new 'nextPage' element, which can be used in subsequent requests.

    The value of the 'page' parameter can be set to 'lastRequested' to return items from the same position as the last successful request. Setting the value of the page to 'lastRequested' is equivalent to setting the value of the page to 'XXX' where XXX is the last requested page.

    If the value of the page specified in the first request is 'lastRequested', then the response will contain events from the page value returned by the 'Create subscription' operation.

  • The value specified in the parameter is used to return the 'nextPage' element after the specified timestamp. This may used to retrieve historical events, rather than recent events. The 'page' parameter should not be specified, if this value is specified. The value must be specified in 'YYYY-MM-DD HH:MM:SS' format and UTC time zone. Note that If the 'since' parameter sent with a timestamp which is earlier then the time when the subscription was created, some events may be returned but it is not guaranteed. Such events also may not be enriched with the additional information, which was requested using the 'fields' parameter with the created subscription. This happens because the system starts collecting the events (and collect additional information for them) after creating subscription.
  • The identifier of a previously created subscription. If specified, only the events matching the subscription's filter are returned in the response.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Events Collection
Type: object
Title: Events Collection
The collection of events.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : Event
Type: object
Title: Event
The array of events.
Show Source
Match All
Show Source
Nested Schema : Request Event
Type: object
Title: Request Event
The object containing details of the request event.
Show Source
Match All
Show Source
Nested Schema : Inventory Event
Type: object
Title: Inventory Event
The object containing details of the inventory event.
Show Source
Match All
Show Source
Nested Schema : Route Event
Type: object
Title: Route Event
The object containing details of the route event.
Show Source
Match All
Show Source
Nested Schema : Activity Event
Type: object
Title: Activity Event
The object containing details of the activity event.
Show Source
Match All
Show Source
Nested Schema : userEvent
Type: object
Show Source
Match All
Show Source
Nested Schema : resourceEvent
Type: object
Show Source
Match All
Show Source
Nested Schema : Chat Updated
Type: object
Title: Chat Updated
The object containing details of the chat updated event.
Show Source
Match All
Show Source
Nested Schema : Chat Message Sent
Type: object
Title: Chat Message Sent
The object containing details of the Chat Message Sent event.
Show Source
Match All
Show Source
Nested Schema : Broadcast Status Update
Type: object
Title: Broadcast Status Update
The event occurs when the broadcast status of a participant is changed.
Show Source
Match All
Show Source
Nested Schema : Transaction Updated
Type: object
Title: Transaction Updated
The event occurs whenever an operation is done on a transaction through Collaboration. A transaction through Collaboration is the transfer of an inventory or activity through chat.
Show Source
Match All
Show Source
Nested Schema : Activity Link Event
Type: object
Title: Activity Link Event
The object containing details of the activity link event.
Show Source
Match All
Show Source
Nested Schema : Resource Preference Event
Type: object
Title: Resource Preference Event
The object containing the details of the resource preference event.
Show Source
Match All
Show Source
Nested Schema : Event Generic Fields
Type: object
Title: Event Generic Fields
The list of generic fields of the event.
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.
  • Title: Time
    The event time is in the UTC time zone and in the 'YYYY-MM-DD HH:MM:SS' format.
  • Title: User
    The login name of the user who performed the action that triggered the event.

    Note: Some actions are performed by the Oracle Field Service Cloud application. Therefore, the parameter is not returned, if the action is not performed by the user.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

Examples

The following example shows how to get events by submitting a GET request on the REST resource using cURL.

curl -H 'Accept: application/json' \
'https://<instance_name>.etadirect.com/rest/ofscCore/v1/events?subscriptionId=a0fd97e62abca26a79173c974d1e9c19f46a254a&page=160425-457%2C0'

Example of Request Header

The following shows an example of the resquest header.

GET /rest/ofscCore/v1/events?subscriptionId=a0fd97e62abca26a79173c974d1e9c19f46a254a&page=160425-457%2C0 HTTP/1.1
Connection: close
Accept-Encoding: gzip,deflate
Authorization: Basic bXlyb290QHFhNTUwMzox
Host: <instance_name>.etadirect.com
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

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.

{
        "found": true,
        "nextPage": "160425-457,1",
        "items": 
            [
              {
                "eventType": "requiredInventoryCreated",
                "time": "2016-04-25 12:36:11",
                "user": "myroot",
                "activityDetails": 
                  {
                    "activityId": 19828,
                    "resourceId": "Ira1",
                    "date": "2016-04-25"
                  },
                  "requiredInventoryDetails": 
                    {
                      "inventoryType": "CABLE_MODEM"
                    },
                  "requiredInventoryChanges": 
                    {
                     "quantity": "1"
                    }
              }
   		  ],
        
	   "links": [
            {
                "rel": "describedby",
                "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/metadata-catalog/events"
            },
            {
                "rel": "canonical",
                "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/events/?subscriptionId=a0fd97e62abca26a79173c974d1e9c19f46a254a&page=160425-457,0"
            },
            {
                "rel": "next",
                "href": "https://<instance_name>.etadirect.com/rest/ofscCore/v1/events/?subscriptionId=a0fd97e62abca26a79173c974d1e9c19f46a254a&page=160425-457,0"
            }
              ]
}
Back to Top