vendredi 1 septembre 2017

How to get the actual image?

I am using the following API to get the messages from the web.whatsapp:

http://ift.tt/2nz8Ibm

The feedback I get from the API when I get an image is:

{
    "id":
{
    "fromMe":false,
    "remote":"553195331953@c.us",
    "id":"C64CED084FB0DDAE34A366BA31B64D",
    "_serialized":"false_553195331953@c.us_C64CED084FB0DDAE34A366BA31B64D"
},
"body":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCABRAC0DASIAAhEBAxEB/8QAGwAAAQUBAQAAAAAAAAAAAAAAAwACBAUGAQj/xAA5EAACAQMCAgUICAcAAAAAAAABAgMABBEFIRIxExRBUXEGIjJhcpGxwRUjNEJigaHhBxYzUpKy0f/EABgBAAMBAQAAAAAAAAAAAAAAAAABAgQD/8QAHREAAwEAAgMBAAAAAAAAAAAAAAECEQMhEhNBUf/aAAwDAQACEQMRAD8A82ojqj+a/TDckHbhI/epNsw6u/CJeNRxOM4AHL5ijFoG1d167J0DOQZeiAyOwhc8s12aVINScQ3iSxs3nN0ZAOOQ+VaksMre9C6xH1SNkmn4hkuB93fbftqQ+puqxOL6d0wvEoJwO4H3UMNwak0Zns+B5CZAVyi47MjOR2bVIe2ayvVs3l0+4jllDuVbCrj1kbbE48apJkPBsuozIExqDsrfhyAe6uXd8C46WW3kcAZcxhs7eFPksTb3kdo1vaSJLKWULcqeEHvbOBt2muS6VJYogutOjkLksrJODkfkT308Yk5IN2zh45IrlHZVChVTHcN/XRrkySW9vwSWrNEpcsAeJiewg7ZHLb9aInUSd5BUuGCwflMo8dqanRO8+FYjPLbKrxW/SiTjDEY2HYRjeiEPcpLEbWHpOJQpXCk99XUdjZt6NzH76j9QKa7b9FMAiKZA4PI8vfnFX4Mj2LsHePDOktuNFiguGQkSRyN5vhliPVUS4Maxwi5sbhuFeBfrSdh8OdaW8sp7qI8V0ZGUEpxtnBO/xpnkpPqNvpeIpFVGkLYYDOdh8qpw9whciU6Zy1sklYDhFXMGgq4H1YqvtmKsCNqurTUJEIHGwohT9Dkq/g3+Wl59HXT5O8uEMMeNWg1SQY3U+K1Ji1JjjdT4iu3jJnd8hnj5OuDs0nvro0a5jHDHLKq9wP7Vp/pIZGVFI6ih+6tDhAuWzG20Sk75/KrKC2iPa2fZ/etYn8P9UgPOzl9m4Uf7EVKh8jNWA+w8XsTRt8GqZUlXf4ZWOzjYf1APEGnizUejIv6/8rTt5L6pEfO0y9I/DCz/AAFDfRLtB9bY3ceP74HX4irWHJ0zOdTcjZ1/yFDNpID6Q94q+bTwpIIIPcaCdPJPKniBch6dW3gbnGnupradZv6UEZ/KhJOO+jLMO+sxeA/obTyfssWfUtOGj2o9HpEH4XIoyzDvoiyA9tLoCJ9ExDlNcjxlY/OgyaLE7edIT7SKfiKsw/rpcQoApB2UQUqVBQ9aMvOlSoQg1OFKlQI//9k=",
"type":"image",
"t":1504191603,"notifyName":"",
"from":"553195331953@c.us",
"to":"553197061722@c.us",
"self":"in",
"ack":-1,
"invis":true,
"star":false,
"clientUrl":"http://ift.tt/2eL31lY",
"mimetype":"image/jpeg",
"filehash":"e3nUffgi2QdLu7fg9G1dsG/jxySqt9/M82VACD3UZ+E=",
"size":45428,
"mediaKey":"XOGjo6DlE6FGv2ozxLs8XvJgnppMKL9Lta8GUk5GT8k=",
"width":719,
"height":1280,
"broadcast":false
}

This part is the thumbnail:

"body":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKC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EfO0y9I/DCz/AAFDfRLtB9bY3ceP74HX4irWHJ0zOdTcjZ1/yFDNpID6Q94q+bTwpIIIPcaCdPJPKniBch6dW3gbnGnupradZv6UEZ/KhJOO+jLMO+sxeA/obTyfssWfUtOGj2o9HpEH4XIoyzDvoiyA9tLoCJ9ExDlNcjxlY/OgyaLE7edIT7SKfiKsw/rpcQoApB2UQUqVBQ9aMvOlSoQg1OFKlQI//9k="

I get the thumbnail using base64, but I'm not sure how I can get the actual image.




Aucun commentaire:

Enregistrer un commentaire