You need to sign in to do that
Don't have an account?
PDes
pdf to grab from an external url
In the response from 3rd party I am getting url, I want to grab that url and save that pdf in a salesforce object.
If I manually use that url and paste in browser it downloads the file. But when I use pagereference method to show in apex it doesnt show the file.
String url1 = 'some external url' //this I get in httpresponse from 3rd party
Pagereference pg = new Pagereference(url1);
Blob b = pg.getContentAsPDF();
How can I grab this url and save pdf file in Salesforce.
If I manually use that url and paste in browser it downloads the file. But when I use pagereference method to show in apex it doesnt show the file.
String url1 = 'some external url' //this I get in httpresponse from 3rd party
Pagereference pg = new Pagereference(url1);
Blob b = pg.getContentAsPDF();
How can I grab this url and save pdf file in Salesforce.
I see you also reached out on https://salesforce.stackexchange.com/questions/369287/get-pdf-from-external-url
Recommend reviewing https://salesforce.stackexchange.com/questions/241640/how-to-download-a-pdf-file-with-public-url
https://salesforce.stackexchange.com/questions/216525/how-to-save-renderas-pdf-in-files-folder