Facebook API Private Message image expired - How to get new image ? URL signature expired -


i'm helping maintain app integrates facebook, , has lots of archived links old private message images. these images expire, , go facebook , request new image. works 90% of time.

about 10% of time we're getting response can't tell new image is.

what's proper way request new url expired facebook private message image, preferably using v2.5 or newer of graph api?

currently we're doing request facebook's graph api using message id of private message so:

https://graph.facebook.com/v2.3/m_mid.xxxxxxxxx:yyyyyyyyy

and gives response has bunch of attachments in it. 90% of use cases, there's new attachment has url or name field new filename contains old filename, e.g. old file name being xxx, we'd see new filename ....xxxx.... in url field.

attachments [url='*%s*']/image_data/url attachments [name='*%s*']/image_data/url 

or sometimes

picture 

but doesnt match now, bunch of attachments no way map new image.

we haven't been able find graph api way of doing this, have following solutions we're considering:

  • when there's 1 attachment in response, use 1 url. works of time, fails when there's more 1 image of course

  • save more metadata image, @ worst case md5 of file. compare md5's of other files until 1 want. instead of md5, consider using info file head request. of untested.

  • update our old message metadata new metadata whenever happens, avoiding problem entirely new image requests come new metadata.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -