Magento – How to get pdf file in response for Magento 2 rest api

magento2pdfrest api

Currently Magento 2 is providing JSON and XML response in web REST API
I want to include a custom response format PDF.

So if any third-party will call our API then we can sen them PDF in response.

Best Answer

Just my idea: We shouldn't do this. We can add the download link or generated link to API response. There are some additional points:

  • How about your server resource if serving PDF each time calling. Your server can be stress. We should consider about this case.
  • Should consider security in this case as well.
Related Topic