Class: Knockapi::Resources::Users::Feeds
- Inherits:
-
Object
- Object
- Knockapi::Resources::Users::Feeds
- Defined in:
- lib/knockapi/resources/users/feeds.rb,
sig/knockapi/resources/users/feeds.rbs
Overview
A user is an individual from your system, represented in Knock. They are most commonly a recipient of a notification.
Instance Method Summary collapse
-
#get_settings(user_id, id, request_options: {}) ⇒ Knockapi::Models::Users::FeedGetSettingsResponse
Returns the feed settings for a user.
-
#initialize(client:) ⇒ Feeds
constructor
private
A new instance of Feeds.
-
#list_items(user_id, id, after: nil, archived: nil, before: nil, exclude: nil, has_tenant: nil, inserted_at: nil, locale: nil, mode: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {}) ⇒ Knockapi::Internal::EntriesCursor<Knockapi::Models::Users::FeedListItemsResponse>
Some parameter documentations has been truncated, see Models::Users::FeedListItemsParams for more details.
Constructor Details
#initialize(client:) ⇒ Feeds
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Feeds.
107 108 109 |
# File 'lib/knockapi/resources/users/feeds.rb', line 107 def initialize(client:) @client = client end |
Instance Method Details
#get_settings(user_id, id, request_options: {}) ⇒ Knockapi::Models::Users::FeedGetSettingsResponse
Returns the feed settings for a user.
22 23 24 25 26 27 28 29 |
# File 'lib/knockapi/resources/users/feeds.rb', line 22 def get_settings(user_id, id, params = {}) @client.request( method: :get, path: ["v1/users/%1$s/feeds/%2$s/settings", user_id, id], model: Knockapi::Models::Users::FeedGetSettingsResponse, options: params[:request_options] ) end |
#list_items(user_id, id, after: nil, archived: nil, before: nil, exclude: nil, has_tenant: nil, inserted_at: nil, locale: nil, mode: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {}) ⇒ Knockapi::Internal::EntriesCursor<Knockapi::Models::Users::FeedListItemsResponse>
Some parameter documentations has been truncated, see Models::Users::FeedListItemsParams for more details.
Returns a paginated list of feed items for a user in reverse chronological order, including metadata about the feed. If the user has not yet been identified within Knock, an empty feed will be returned.
You can customize the response using response filters to exclude or only include specific properties on your resources.
Notes:
- When making this call from a client-side environment, use your publishable key along with a user token.
- This endpoint’s rate limit is always scoped per-user and per-environment. This is true even for requests made without a signed user token.
- Any attachments present in trigger data are
automatically excluded from both the
dataandactivitiesfields ofUserInAppFeedResponse.
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/knockapi/resources/users/feeds.rb', line 91 def list_items(user_id, id, params = {}) parsed, = Knockapi::Users::FeedListItemsParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/users/%1$s/feeds/%2$s", user_id, id], query: query, page: Knockapi::Internal::EntriesCursor, model: Knockapi::Models::Users::FeedListItemsResponse, options: ) end |