class MessageQuickly::Api::UserProfile

Public Class Methods

find(id) click to toggle source
# File lib/message_quickly/api/user_profile.rb, line 5
def self.find(id)
  # curl -X GET "https://graph.facebook.com/v2.6/<USER_ID>?fields=first_name,last_name,profile_pic&access_token=<PAGE_ACCESS_TOKEN>"
  # {
  #   "first_name": "Peter",
  #   "last_name": "Chang",
  #   "profile_pic": "https://fbcdn-profile-a.akamaihd.net/hprofile...70ec9c19b18"
  # }
  UserProfile.new.find(id)
end

Public Instance Methods

find(id) click to toggle source
# File lib/message_quickly/api/user_profile.rb, line 15
def find(id)
  json = @client.get(id, { fields: 'first_name,last_name,profile_pic,locale,timezone,gender' })
  Messaging::User.new(json)
end