pimax/fb-messenger-php

How to get a send image

Closed this issue · 1 comments

How do i get a image send the the Messenger App to the Bot. Is there a option for that?

actually when i'm debugging we can get any responses form user. And of course we can get it to our database. here's the response when user send us an image:

{  
    "sender":{  
        "id":"[sender-id]"
    },
    "recipient":{  
        "id":"[recipient-id]"
    },
    "timestamp":1466768830583,
    "message":{  
        "mid":"mid.1466768756818:0ccf263a2496de4d42",
        "seq":1072,
        "attachments":[  
            {  
                "type":"image",
                "payload":{  
                    "url":"https://blablablabla"
                }
            }
        ]
    }
}

to get it from that structure you can use this:

$message['message']['attachments'][0]['payload']['url']