Skip to content

Commit

Permalink
Log API request and response to Facebook when connecting Messenger ti…
Browse files Browse the repository at this point in the history
…pline (#1918)

Log API request and response to Facebook when connecting Messenger tipline

Reference: CV2-4559.
  • Loading branch information
caiosba committed Jun 7, 2024
1 parent a8ad509 commit ff12dfb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/api/v1/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def save_facebook_credentials_for_smooch_bot(platform) # "platform" is either "i
limit: 100,
}
response = Net::HTTP.get_response(URI("https://graph.facebook.com/me/accounts?#{q_params.to_query}"))
Rails.logger.info("[Facebook Messenger Integration] API scoped token: #{auth['token']} API response: #{response.body}")
pages = JSON.parse(response.body)['data']
if pages.size != 1
CheckSentry.notify(StandardError.new('Unexpected list of Facebook pages returned for tipline Messenger integration'), team_bot_installation_id: tbi.id, response: response.body)
Expand Down

0 comments on commit ff12dfb

Please sign in to comment.