How to Virus Scan Files in SharePoint Online Site Drive with JavaScript

Detecting tainted files in storage is crucial for keeping your SharePoint Online Site Drive safe from viruses and malware.

Thankfully, there’s a Cloudmersive API for that. Our Virus Scanning API contains an iteration specifically designed to accompany your Site Drive instance, and once configured it’ll check each new file for viruses, malware, trojans, ransomware, spyware and more, leveraging over 17 million stored signatures.

At the bottom of this article, we’ve provided instructions to help structure your API call with JavaScript. To take advantage of this API, however, you’ll also need a ClientID & clientSecret, with are attainable by following instructions on the Cloudmersive API Console under the POST /virus/scan/cloud-storage/sharepoint-online/site/single dropdown.

To install the jQuery library, run the following command:

bower install jquery

After that, include the below code to structure your API call. Note that you’ll need to include your SharePoint Domain Name, SiteID, and the File Path:

var settings = {
"url": "https://api.cloudmersive.com/virus/scan/cloud-storage/sharepoint-online/site/single",
"method": "POST",
"timeout": 0,
"headers": {
"clientID": "<string>",
"clientSecret": "<string>",
"sharepointDomainName": "<string>",
"siteID": "<string>",
"tenantID": "<string>",
"filePath": "<string>",
"itemID": "<string>",
"Apikey": "YOUR-API-KEY-HERE"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});

All done. Once configured, you’ll have added a big boost to your SharePoint threat profile, ensuring sneaky malicious files don’t sit dormant in storage.

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Validate an Email Address for Correct Syntax in Node.JS

Make Static Gatsby Stateful — using the new hooks

Creating a Moving Platform

Shadow DOM != Virtual DOM

Golang for Javascript Developers

JavaScript Basic Concept

Understanding Recursion

Statements and expressions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Best Databases For Web App Development

How to Send a Message by WhatsApp API using vbnet

How to Send a Message by WhatsApp API using vbnet

How to Setup a HarperDB Instance in a Node.js REST API

Computer Based Testing System