Announcement

Collapse
No announcement yet.

GET attachment via api

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

  • Russ
    replied
    Guzzle helped, thanks yuri

    Leave a comment:


  • Russ
    replied
    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

    Leave a comment:


  • Kharg
    replied
    Hi Russ are you trying to get the file content in base64?

    Leave a comment:


  • yuri
    replied
    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.

    Leave a comment:


  • Russ
    started a topic GET attachment via api

    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.
Working...
X