class Api::V2::UsersController

Has to be authenticated with :user_email and :user_token

Information returns in <user_info>;

{:name=>"sharn722",
 :id=>229,
 :email=>"sharn722@gmail.com",
 :bio=>"",
 :contributions=>1,
 :projects=>1,
 :collaborations=>1,
 :institute=>"UOK",
 :profile_url=>"http://localhost:3000/users/sharn722",
 :avatar=>
  {:original=>"/avatar.png",
   :thumb=>"/assets/thumb_avatar.png",
   :medium=>"/assets/medium_avatar.png"},
 :latest_activity=>Wed, 08 Apr 2015 13:11:25 UTC +00:00,
 :badges=>[{:name=>"", :url=>""}]}

Public Instance Methods

info() click to toggle source

Returns logged in user's profile

GET /api/v2/users/info(.:format)

Ex;

get :info, {:user_email => foo@bar.com, :user_token => "xxxxxxx"}

Output;

On success - {:status => "success", :user => <user_info>}
On failed - {:status => "failed", :notice => "..."}
# File app/controllers/api/v2/users_controller.rb, line 40
def info
  @user = current_user
  
  if @user
    render json: {status: "success", notice: "Record found", user: @user.info}
  else
    render json: {status: "failed", notice: "Error: Couldn't find a user with email #{params[:user_email]}"}
  end
end