From ff12dfb122512d43d537c705a256978d5e1e74e2 Mon Sep 17 00:00:00 2001 From: Caio Almeida <117518+caiosba@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:11:13 -0300 Subject: [PATCH] Log API request and response to Facebook when connecting Messenger tipline (#1918) Log API request and response to Facebook when connecting Messenger tipline Reference: CV2-4559. --- app/controllers/api/v1/admin_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/v1/admin_controller.rb b/app/controllers/api/v1/admin_controller.rb index c74e45cf80..b3488122c0 100644 --- a/app/controllers/api/v1/admin_controller.rb +++ b/app/controllers/api/v1/admin_controller.rb @@ -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)