Announcement

Collapse
No announcement yet.

Guidance for downloading documents from REST API [PHP]

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

  • Guidance for downloading documents from REST API [PHP]

    Hi all, seeking some advise please.

    I have an application which is a dashboard and external document portal, extending an instance of a CRM.

    When I call through the API to get files, it works just fine in Postman, but I'm not sure how to store the file correctly as PHP treats my assignment as a failure:

    PHP Code:
    if($file $client->request('GET''Attachment/file/'.$document['fileId'])){ echo "test"; } 
    The code inside the if statement is never executed. However, I can load the doc in a Postman test.

    (https://docs.espocrm.com/development...t/#downloading)


    Any guidance is appreciated.
    Last edited by barontech; 08-23-2021, 10:49 PM.

  • #2
    I found a solution and opened a PR for a fix in the PHP class: https://github.com/espocrm/documentation/pull/709

    Comment

    Working...
    X