I am new to Google application scripting. I use the Googles function to access the DFA / DCM Trafficking and Reporting APIs through application scripts without using OAuth.
When I run the DCM report and then convert to Google Sheets, I cannot figure out how to use either the URLs that I supply to download the CSV.
Here is the code I'm using.
var file = DCM.Reports.run(profile.profileId,30792432);
var file2 = DCM.Files.get(30792432, file.id);
file2 = DCM.Files.get(30792432, file.id);
var response = UrlFetchApp.fetch(file2.urls.browserUrl);
I am also trying to use:
file2.urls.apiUrl();
for the UrlFetchApp team, but that didn't work either.
Any help on how to implement the URL to download the file as an object into which I can embed in Google Sheets would be greatly appreciated.
Thank!
source
share