2

I'm trying to integrate my apps with salesforce Live Agent through REST API.

I already read the Guide here (https://resources.docs.salesforce.com/212/latest/en-us/sfdc/pdf/live_agent_rest.pdf), but I can't find how to send an attachment from visitor to agent with API.

I got this response from salesforce when agent give permission to sending file, but i see no guide about this one.

     {
        "type": "FileTransfer",
        "message": {
            "uploadServletUrl": "https://cs6.salesforce.com/services/liveagent/file",
            "fileToken": "86fc8ee3-xxxx-407c-9939-ec5be0948e71",
            "cdmServletUrl": "https://cs6.salesforce.com/liveagent/chatwindowfiletransfer.jsp",
            "type": "Requested"
        }
    }

Maybe someone can help me, through this problem?

Thank you.

0

File upload is not officially supported by the Live Agent REST API. This is currently a limitation acknowledged by Salesforce support as of 3rd July 2019.

You can still make it work, however it carries the risk of using an undocumented functionality.

The request to the upload servlet should be modeled based on the following CURL command:

curl "https://cs6.salesforce.com/services/liveagent/file?orgId=00Dxxxxxxxxxxxx&chatKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&fileToken=86fc8ee3-xxxx-407c-9939-ec5be0948e71&encoding=UTF-8" -F "filename=test.jpg" -F "file=@/home/user1/Desktop/test.jpg"

As you can see, the request has the following parameters:

  • orgId: your Salesforce organization ID
  • chatKey: your session key (the substring before the "!" character)
  • fileToken: the token received with the file transfer request
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.