Announcement

Collapse
No announcement yet.

GET attachment via api

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GET attachment via api

    Hey guys, please help, can't get attachment (VOIP call recording)



    PHP Code:
    $callRecordingDetails $this->espoAPIService->getCallDetails($call->id);

    public function 
    getCallDetails($id$useCache=false){
        return 
    $this->apiRequest(Client::METHOD_GET'Call/' $idnull$useCache);
    }


    $audioFileContents 
    $this->espoAPIService->getAttachmentContent($callRecordingDetails->voipRecordingFileId);

    public function 
    getAttachmentContent($id){
        return 
    $this->apiRequest(Client::METHOD_GET'Attachment/file/' $id);
    }


    // returns null, when I am doing (Attachment without /file):
    public function getAttachmentContent($id){
        return 
    $this->apiRequest(Client::METHOD_GET'Attachment/' $id);
    }
    ​ 
    I am getting details about the attachment


    Please help me how, do I actually get the file contents?

    Thanks
    Last edited by yuri; 04-03-2024, 06:52 AM.

  • #2
    It's the API client that does not return raw contents.

    Use our official client https://github.com/espocrm/php-espo-api-client or any other API client library like Guzzle.

    Comment


    • #3
      Hi Russ are you trying to get the file content in base64?

      Comment


      • #4
        Originally posted by Kharg View Post
        Hi Russ are you trying to get the file content in base64?
        Raw .wav content, I guess it could be in base64

        Comment


        • #5
          Guzzle helped, thanks yuri

          Comment

          Working...
          X