Read Sharepoint Lists

Hi @arrtee,

okay that looks fine to me…
However I also did not manage to get it to work with the Post Node either :frowning:
Not sure how the correct format for the constant body should be…or if it is just not possible to add form data there :frowning:

Simple Java Code with java snippet nodes works e.g.:

	    HttpPost post = new HttpPost(url);
	    post.setHeader("Content-Type", "application/x-www-form-urlencoded");

	    /* Adding URL Parameters */
	    List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
	    urlParameters.add(new BasicNameValuePair("grant_type", "client_credentials"));
	    urlParameters.add(new BasicNameValuePair("client_id", clientId));
	    urlParameters.add(new BasicNameValuePair("client_secret", m_clientSecret.getPassword()));
	    urlParameters.add(new BasicNameValuePair("resource", resource));
	    
	    post.setEntity(new UrlEncodedFormEntity(urlParameters));

	    HttpResponse response = client.execute(post);


        
	    String json_string = EntityUtils.toString(response.getEntity());
	    String accessToken = null;
	    
	    
        if (response.getStatusLine().getStatusCode()==200)
        {
        	
        	JSONObject temp1 = new JSONObject(json_string);  
    	    accessToken = temp1.get("access_token").toString();
        }	

As well as with the Palladian Web Nodes:

grafik

As well I added a new node to return the Token as a String ( Get Rest Access Token As String Node).
It does the same as the another node and outputs additionally a string variable for the token.
The Update should be availible in a few minutes.

Regarding the “Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException” could you check what part of the sharepoint URL you are using for the parameters:

So if your List is on the first lvl in the BFM_Test sharepoint for the group.sharepoint.com site:
Url in Browser something like: https://group.sharepoint.com/sites/BFM_Test/Lists/Test/AllItems.aspx

Then your configuration of the GETSPListItems node should look like this:
grafik

1 Like