function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Manohar kumarManohar kumar 

how to get authorization code for onedrive ??

Hi All,

i have been trying to upload files to onedrive.its working when i paste the url in the browser for getting the authorization code but when i try to get it in the http get call its giving me 302 response code and in the location header its showing error=invalid_scope&error_description=The  provided  value  for  the  input  parameter  'scope'  is  not  valid.  The  scope  'wl.signi  nwl.offline_access  onedrive.readwrite'  does  not  exist.i am new in webservices so any help would be appreciated.

url i need to call: wl.offline_access onedrive.readwrite

my code 

public void GetCode(){
	      http h = new http();
	      httpRequest req = new httpRequest();
	    String Clientkey = EncodingUtil.urlEncode(key,'UTF-8');  
	      string str1 ='wl.signi nwl.offline_access onedrive.readwrite';
	      string str2 = EncodingUtil.urlEncode(str1,'UTF-8');
	      string str =''+Clientkey+'&scope='+str2+'&response_type=code&redirect_uri='+redirect_uri;
	      httpResponse res = h.send(req);