Module: Notion::Api::Endpoints::Users
- Included in:
- Notion::Api::Endpoints
- Defined in:
- lib/notion/api/endpoints/users.rb
Instance Method Summary collapse
-
#me ⇒ Object
Retrieves the bot User associated with the API token provided in the authorization header.
-
#user(options = {}) ⇒ Object
Retrieves a User object using the ID specified in the request.
-
#users_list(options = {}) ⇒ Object
Returns a paginated list of User objects for the workspace.
Instance Method Details
#me ⇒ Object
Retrieves the bot User associated with the API token provided in the authorization header. The bot will have an owner field with information about the person who authorized the integration.
11 12 13 |
# File 'lib/notion/api/endpoints/users.rb', line 11 def me get("users/me") end |
#user(options = {}) ⇒ Object
Retrieves a User object using the ID specified in the request.
20 21 22 23 |
# File 'lib/notion/api/endpoints/users.rb', line 20 def user( = {}) throw ArgumentError.new('Required arguments :user_id missing') if [:user_id].nil? get("users/#{options[:user_id]}") end |
#users_list(options = {}) ⇒ Object
Returns a paginated list of User objects for the workspace.
Paginate through collections of data by setting the cursor parameter to a start_cursor attribute returned by a previous request’s next_cursor. Default value fetches the first “page” of the collection. See pagination for more detail.
36 37 38 39 40 41 42 43 44 |
# File 'lib/notion/api/endpoints/users.rb', line 36 def users_list( = {}) if block_given? Pagination::Cursor.new(self, :users_list, ).each do |page| yield page end else get("users", ) end end |