Description
Create a new activity and post it to the system or add a system post and users to an existing activity.
URL
POST: .../rest/api/V2/apps/{appId}/events
Headers
- Authorization: Basic authentication with user/password of a user defined in the user repository.
- Content-Type: application/json
- X-CSRF-HPMEAP: FROM-APP
Body
See Event Body.
Remarks
Example of the use of this resource:
-
A new expense report is created on the system, using Mobile, Desktop, Web, HP Anywhere, or another UI.
-
This resource is posted, notifying the system that a new report was created.
-
HP Anywhere creates a new activity for the manager with the report as the context object.
-
HP Anywhere pushes a notification to the manager.
-
The manager can click the activity on the front page and see the report detail page for the new report.
Context Object
If event context object does not exist in any activity:
- A new activity is created with the context object, users, subject and visibility according to the handleEvent JSON.
- A system post is added to the activity, with the message received in the request body. The same message is sent to push notification service.
If the event context object exists in one or more activities:
- Users are added according to the users list in the JSON, unless they are already in the participants list.
- A system post is added to the activity, with the message received in the request body. The same message is sent to push notification service.
Notifications
A notification is set to each user if:
- Channel is enabled in the admin setting.(Enable/disable functionality is in ee general setting for email and push notification.)
- The notificationType in the request body exists in the App admin setting. The notification type represents a list of notification channels such as frontpage/email/push notificiation.
- The user preferences permit notification. (A user can disable the email and push notification for the handle event flow.)
- "isNotify: false" is not passed for the user in the request body. This applies to push notification and Email.
When adding a user to an existing private conversation, a new private conversation is created with the users in the event.
If notificationType is specified in the request body, the type must exist in your App admin setting. The NotificationType setting is used to define which notification channels are relevant for this event. If the type is not defined in the admin setting, and notificationType is not specified in the request body, the default HP Anywhere notification type is used. The default is FRONTPAGE channel only.
For more details, see the App Supported Notification Types section of the sample XML in topic Admin Settings XML