I’m trying to get access to salesforce report data using oauth token. Some time ago it worked fine, I used the oauth token as session id.
...
URL remoteFile = new URL(instanceURL + "/" + reportId + "?export=1&enc=UTF-8&xf=csv");
URLConnection fStream = remoteFile.openConnection();
fStream.setRequestProperty("Cookie", "sid=" + accessToken);
...
But it doesn’t work, everytime I try to access the url it returns an html page which corresponds to login page. Is there any way I can access report data (not meta-data) using the oauth access_token?
Thanks.
In order to use the token with such a URL you need to set the scope parameter to include
web:The oAuth User Agent Flow documentation details where the
scopeparameter is specified.