Class: Warbler::UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Warbler::UsersController
- Defined in:
- lib/warbler/controllers/users_controller.rb
Instance Method Summary collapse
-
#identify(email, first_name: nil, last_name: nil) ⇒ Object
This endpoint lets you tie a user with his/her activities.
Methods inherited from ApplicationController
Constructor Details
This class inherits a constructor from Warbler::ApplicationController
Instance Method Details
#identify(email, first_name: nil, last_name: nil) ⇒ Object
This endpoint lets you tie a user with his/her activities. You’ll want to identify a user with any relevant information as soon as they log-in or sign-up.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/warbler/controllers/users_controller.rb', line 11 def identify email, first_name: nil, last_name: nil # the base uri for api requests query_builder = base_uri # prepare query string for API call query_builder << "/v3/users" # process optional query parameters query_builder = APIHelper.append_url_with_query_parameters query_builder, { "email" => CGI::escape(email), "first_name" => first_name, "last_name" => last_name, } perform_query('post', query_builder) end |