facebook - Graph API direct message for page: how to retrieve link to attached file -
i need store link file attached direct message (for page, retrieved "/conversations
"). how can that?
i know how link of image. json-object image ("attachments
") contains tag "image_data
", contains tags "url
" , "preview_url
" accessing image.
for attached files (in case e.g. pdf), fb sends "id
", "mime_type
", "name
" , "size
", no additional data. example:
"id": "m_id.158623824339344" .... "attachments": { "data": [ { "id": "7b84fd4c0f18fb4060ae0fe0dcfeb42e", "mime_type": "application/pdf", "name": "attachment1.pdf", "size": 80798 } ] }
but when log fb user , click attachment in browser, link:
https://www.facebook.com/ajax/messaging/attachment.php?attach_id=<attach_id>&mid=id.<mid>&pageid=<pageid>&ext=<ext>&hash=aqcafpyezj2psjrk
by trial , error found out possible access file without "hash
" , "ext
"-part. means in theory able generate link in application ("attach_id
" , "mid
" provided message , know pageid).
but seems unreliable. link might change anytime, breaking application.
i searched lot couldn't find documentation this. know better solution? or can point me documentation regarding issue?
thanks lot!
barbara
sorry not available of v2.5.
if becomes new feature in future, should able find in documentation: https://developers.intern.facebook.com/docs/graph-api/reference/v2.5/message/attachments
Comments
Post a Comment