README.md in oneaccess-0.1.8 vs README.md in oneaccess-0.1.9
- old
+ new
@@ -39,10 +39,12 @@
- Research Document by User ID: _/research/documentByUserId_
- Organization's Product Groups: _/entitlement/organization/productgroup/getList_
- Organization: _/organizations/id_
- User's Product Groups: _/entitlement/user/productgroup/getList_
- User Entitlement Requests: _/entitlement/research/userRequests/getListWithEntitlementsStatus_
+- Subscribe to Entitlements Updates: _/entitlement/userSubscription/subscribeToUpdates_
+- Get User ids which entitlements have changed _/entitlement/userSubscription/subscribeToUpdates/changedUsers/getList_
### User by Email _(/user/getByEmail)_
Official Documentation: http://apidocs.oneaccess.io/docs/usergetorcreate
This method returns a `User` object if it matches the first name, last name, and email. If there's not a match, then a new user is created and returned.
@@ -185,7 +187,46 @@
resp = ONEAccess::API::Entitlement::Research::UserRequests.get_list
resp.data #=> Array of instances of ONEAcess::DataObject::UserEntitlementRequest
rescue ONEAccess::Error::APIError => e
puts "Error listing the available user entitlement requests"
+end
+```
+
+### Subscribe to Entitlements Updates _(/entitlement/userSubscription/subscribeToUpdates)_
+Official Documentation: http://apidocs.oneaccess.io/docs/entitlmentusersubscriptionsubscribetoupdates
+
+This method allows to subscribe for user entitlement updates providing the list of users that one wishes
+to receive updates from. Returns the API Status Code as the result of the subscription operation.
+
+#### How to use:
+```ruby
+begin
+ resp = ONEAccess::API::Entitlement::UserSubscription.subscribe(user_ids: [<user_ids>])
+
+ resp #=> instance of ONEAcess::Response::SubscribeToUpdatesResponse
+rescue ONEAccess::Error::APIError => e
+ puts "Error subscribing users for entitlements updates"
+end
+```
+
+### Get User ids which entitlements have changed _(/entitlement/userSubscription/subscribeToUpdates/changedUsers/getList)_
+Official Documentation: http://apidocs.oneaccess.io/docs/entitlementusersubscriptionsubscribetoupdateschangedusersgetlist
+
+This method allows to get the list of user ids which the entitlements have changed.
+Can be provided a date to get the users who have changed entitlements after the provided date. If the date is not provided then it returns the user ids in which the entitlements have changed after the last call to this method. For example:
+
+First call at 08/22/2016 11:55:00.
+Next call at 08/22/2016 15:55:00. Returns the user ids who have changed entitlements after 08/22/2016 11:55:00.
+
+Use UTC time zone for date parameter.
+
+#### How to use:
+```ruby
+begin
+ resp = ONEAccess::API::Entitlement::UserSubscription.changed_users(from_date: <utc_string_date>)
+
+ resp #=> instance of ONEAcess::Response::ChangedUsersResponse
+rescue ONEAccess::Error::APIError => e
+ puts "Error getting the list of user ids which entitlements have changed"
end
```