Get 'Not authorized' when I download WhatsApp image
Step 1:Upload an image to WhatsApp server and get this response:
{
"name":"1.jpg",
"url":"https://mms832.whatsapp.net/d/At1iopm8E0Mx5zXUsvNVAHDwOUgFS_HgG4Pzc8tY8419.jpg",
"size":"42472",
"mimetype":"image/jpeg",
"filehash":"aY/b0V4ddgTzitsIU7iw+pibhE6K7e2Op7jEd/lGFXI=",
"type":"image",
"width":"550",
"height":"364"
}
Step 2: Open this uploaded image url https://mms832.whatsapp.net/d/At1iopm8E0Mx5zXUsvNVAHDwOUgFS_HgG4Pzc8tY8419.jpg in browser will display:
<p>Not authorized</p>
Headers:
Content-Length 22
Content-Type text/html
Date Mon, 15 Apr 2013 04:52:26 GMT
Server WhatsApp-MMS/2
WWW-Authenticate Basic realm=""
I can not download uploaded image. How to resolve it?
This is indeed some strange behavior. I can open files uploaded from my cellphone just fine, but you cannot view the files you've uploaded yourself. This however does not interfere with sending or receiving images and should only cause problems if you're planning to use WhatsApp as a file upload service.
But to get the full picture (no pun intended): This is the URL you receive after upload request: https://mms833.whatsapp.net/d/An00udPDvo2jVqwwWGU-V4vt_FKbezI8cTJhwPx9pRas.jpg And this is the URL the contact will receive: https://mms833.whatsapp.net/d/KpY0TRlX0-j1edgtrlSIX1xTw5U/An00udPDvo2jVqwwWGU-V4vt_FKbezI8cTJhwPx9pRas.jpg (Don't judge me, I had to quickly make a unique image and yes I'm still immature like that)
The first URL seems to be the actual file locator which we all don't have access to. The second URL adds the path "KpY0TRlX0-j1edgtrlSIX1xTw5U/" which seems to be some sort of access key.
Then again, this does not impact the proper functioning of this API and seems to be expected behavior. Just another layer of security.
Agree.
I have an idea.
From number and To number are same number(eg: 12345678):
Send the uploaded image to self number to get the second image url.
Why would you want to do this? WhatsApp limits the image size and overusing this feature will get you blocked. There are much better file upload services out there (if that's what your exploit is about) :)
I rarely upload photos and do not like to keep uploaded photo in my application.