Salesforce reports access using oauth as session id

I am trying to access Salesforce report data using oauth token. Some time ago it worked fine, I used the oauth token as a session identifier.

... URL remoteFile = new URL(instanceURL + "/" + reportId + "?export=1&enc=UTF-8&xf=csv"); URLConnection fStream = remoteFile.openConnection(); fStream.setRequestProperty("Cookie", "sid=" + accessToken); ... 

But this will not work, every time I try to access the url, it returns an html page that corresponds to the login page. Is there a way to access report data (not metadata) using oauth access_token?

Thanks.

+4
source share
1 answer

To use a token with such a URL, you need to set the scope parameter to web :

web Allows the use of access_token on the Internet.

Documentation of the User Agent thread User Agent where the scope parameter is specified.

+3
source

Source: https://habr.com/ru/post/1415024/


All Articles