From bc294d88296b62ebabfae4d6a960ed06a1fb2c0e Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 4 Mar 2025 15:02:09 +0530 Subject: [PATCH] chore: add comment for response format --- app/controllers/facebook/delete_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/facebook/delete_controller.rb b/app/controllers/facebook/delete_controller.rb index ec99b1491..214885d01 100644 --- a/app/controllers/facebook/delete_controller.rb +++ b/app/controllers/facebook/delete_controller.rb @@ -10,6 +10,10 @@ class Facebook::DeleteController < ApplicationController Webhooks::FacebookDeleteJob.perform_later(id_to_process) status_url = "#{app_url_base}/facebook/confirm/#{id_to_process}" + # IMPORTANT: Do not change the response format below. + # Facebook's Data Deletion Request system specifically expects responses in this format + # with a 'url' for status confirmation and a 'confirmation_code' field. + # See: https://developers.facebook.com/docs/development/create-an-app/app-dashboard/data-deletion-callback/#implementing render json: { url: status_url, confirmation_code: id_to_process }, status: :ok rescue InvalidDigestError render json: { error: 'Invalid signature' }, status: :unprocessable_entity