+ Start a Discussion
Hemant Pareek 8Hemant Pareek 8 

Integrating facebook messanger with salesforce

I want to send message from a rest api hit to facebook messanger. for this I reffered the link : https://developers.facebook.com/docs/messenger-platform/send-messages/?translation#sending_text but on hitting the api am getting error.
Httprequest req = new httpRequest();
String body = '{'+
                '"recipient": {'+
                '"id": "1229442117258672"'+
                '"message": {'+
                '"text": "hello, world!"' +
                '}' +
Http h = new Http();
HttpResponse res = h.send(req);

Error: { "error": { "message": "(#100) No matching user found", "type": "OAuthException", "code": 100, "error_subcode": 2018001, "fbtrace_id": "AHlqjvar_5mQ78CT1iMu4Ac" } }

Note: The page access token is alive when I tested it and the id provided is recipient is a valid id retrieved by hitting get request using graph api explorer via recipient's facebook account also the sender have the page_messaging permission.
Henny GoelHenny Goel
Check ford f150forum (https://f150mag.com/)