question

OliverMario-7381 avatar image
0 Votes"
OliverMario-7381 asked RaytheonXie-MSFT edited

Sharepoint application server side writing

Hello,

I am new to the Microsoft world and I would like to write an application to see if a file has been added or changed in Sharepoint.
I have read that you can use the Event Remote Receiver for this. But as far as I understand it, this can only be done as an add-in application.
I would like to send a message(JSON) (RESTestful) to a client (one self-written Python program) when a file has been changed or added.

So I would like to know if this can be solved with ASP.NET Core MVC and if this can be run on a server so that everyone with this client is notified.

I would be very happy about a nice answer, and please don't be so strict with me since I'm a beginner with ASP.NET etc. at the moment (as already mentioned ;-)).


Thanks in advance :-)

dotnet-csharpoffice-sharepoint-onlinesharepoint-devoffice-addins-devdotnet-aspnet-core-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered APIPointNewbie-3149 commented
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OliverMario-7381 avatar image
0 Votes"
OliverMario-7381 answered OliverMario-7381 commented

Hello, thanks for the quick reply, my question:

Which programming language/framework can I use to implement webhooks ?

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It is a REST api so you can use any language you like. Besides c#, node is popular. Here is a python example

https://martinnoah.com/sharepoint-rest-api-with-python.html#.YP7I7i1Ha-o

0 Votes 0 ·

Hello, thank you for your answer:

I am looking for a way how to be notified when a file has been added or changed.
Meanwhile I think you need a webhook ;-)

Unfortunately I can't find any webhook stuff for Python, Java etc.
Except simple CRUD operations

0 Votes 0 ·

Hi @OliverMario-7381 ,
Since we consider to use webhook.
But webhook is out of our support scope. You can get answers from webhook support.

0 Votes 0 ·
Show more comments
RaytheonXie-MSFT avatar image
1 Vote"
RaytheonXie-MSFT answered RaytheonXie-MSFT commented

Hi @OliverMario-7381 ,
You can use ASP.NET for programming.Take following link as reference:
https://docs.microsoft.com/en-us/sharepoint/dev/apis/webhooks/get-started-webhooks


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @OliverMario-7381 ,
I am checking to see how things are going there on this issue.

0 Votes 0 ·

In ASP Net:

I get after the first start in the following class this message:

Error CS7069 The reference to type "TokenValidationParameters" was supposedly declared in "System.IdentityModel.Tokens.Jwt" but could not be found.

Error CS0246 The type or namespace name "TokenValidationParameters" was not found (possibly missing a using directive or assembly reference).

In the class:

 namespace WebApplication
 {
     public partial class Startup
     {
         public void ConfigureAuth(IAppBuilder app)
         {
             app.UseWindowsAzureActiveDirectoryBearerAuthentication(
                 new WindowsAzureActiveDirectoryBearerAuthenticationOptions
                 {
                     Tenant = ConfigurationManager.AppSettings["ida:Tenant"],
                     TokenValidationParameters = new TokenValidationParameters {
                          ValidAudience = ConfigurationManager.AppSettings["ida:Audience"]
                     },
                 });
         }
     }
 }
0 Votes 0 ·

Hi @OliverMario-7381 ,
It seems don't support System.IdentityModel.Tokens.Jwt 5.0.0,please use 4.x

0 Votes 0 ·
Show more comments
APIPointNewbie-3149 avatar image
0 Votes"
APIPointNewbie-3149 answered Bruce-SqlWork commented

Is it possible to write Sharepoint Webhooks(Spring Boot) in Java or Python ?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

As web hooks are REST api, and SharePoint has a REST api, the only requirement is the language have an sdk to build a web server code, and make http calls.

Note you can also use azure functions or AWS lambdas, which support a large number of languages.

0 Votes 0 ·

Interesting, so for example if I can put the Microsoft Graph SDK for Java into a Spring boot application, I can also use Webhooks and the Search API via the SDK ?


0 Votes 0 ·

Sure, but I typically don’t use the sdk from c# I just use httpclient and the endpoints.

0 Votes 0 ·