Get the Attachment URL
Description
To download a file attachment given the attachment URL. The attachment url can be found in the chat transcript.
chat_id - A Unique ID is provided to each visitor on your website.
Pre-requisite
A valid OAuth Token is mandatory.
Click to view the list of Sample Response Params
URL
Copiedhttps://salesiq.zoho.com/api/v1/<screenname>/chats/<chat_id>/<attachmenturl>
Example
Copiedhttps://salesiq.zoho.com/api/v1/zylker/chats/150/attachments/2285371691914775377/A_1461735476414
Success Response
Copied{
"data": {
"content-length": 157932,
"download_url": "https://salesiq.zoho.com/pubdownload/d66ad355-ee23-4b3c-9e5f-d80bb112a7fa"
}
}
Error Codes
1. General Error
This error is sent in case of internal server error while getting the temporary URL for the attachment.code : 2040Error Message : "Unable to retrieve the attachment"
2. Invalid chat_id
This error is sent when the chat_id given is wrong.code : 2041Error Message : "Invalid chat_id"
3. Attachments_empty
This error is sent when there are no attachments available for the given chat id.code : 2042Error Message : "No Attachments available for this chat"
4. Requested Invalid file
This error is sent when there is no attachment found for the given attachment URL.code : 2043Error Message : "File Not Found"
5. Requested Non-Department Chat Transcript
This error is sent when the attachment requested does not belong to user's department. code : 2044Error Message : "This chat containing the attachment belongs to a department you do not belong to"
Error Response - Example
Copied{
"error": {
"message": "No Attachments available for this chat ",
"code": 2042
}
}
Sample transcript that contains an attachment
Copied{
"time": "1461321097487",
"dname": "Djayakumar",
"msg": {
"dim": {
"height": "1280.0",
"width": "720.0"
},
"content": "image/png",
"fileId": "A_1461321096778",
"url": "/attachments/2285371690226238428/A_1461321096778",
"fName": "2016-04-14-22-04-25.png",
"size": "108388"
},
"mode": "att"
}