class MessageQuickly::Api::AccountLink
Public Class Methods
page_scoped_id(account_linking_token)
click to toggle source
# File lib/message_quickly/api/account_link.rb, line 5 def self.page_scoped_id(account_linking_token) # curl -X GET "https://graph.facebook.com/v2.6/me?access_token=PAGE_ACCESS_TOKEN \ # &fields=recipient \ # &account_linking_token=ACCOUNT_LINKING_TOKEN" # { # "id": "PAGE_ID", # "recipient": "PSID" # } AccountLink.new.page_scoped_id(account_linking_token) end
unlink_account(page_scoped_id)
click to toggle source
# File lib/message_quickly/api/account_link.rb, line 22 def self.unlink_account(page_scoped_id) # curl -X POST -H "Content-Type: application/json" -d '{ # "psid":"PSID" # }' "https://graph.facebook.com/v2.6/me/unlink_accounts?access_token=PAGE_ACCESS_TOKEN" # { # "result": "unlink account success" # } AccountLink.new.unlink_account(page_scoped_id) end
Public Instance Methods
page_scoped_id(account_linking_token)
click to toggle source
# File lib/message_quickly/api/account_link.rb, line 17 def page_scoped_id(account_linking_token) json = @client.get("me", { fields: 'recipient', account_linking_token: account_linking_token }) json['recipient'] end
unlink_account(page_scoped_id)
click to toggle source
# File lib/message_quickly/api/account_link.rb, line 33 def unlink_account(page_scoped_id) json = @client.post("me/unlink_accounts", { psid: page_scoped_id }) json['result'] == "unlink account success" end