Advanced Scan a File in your SharePoint Online Site Drive in Go
Apply a strong layer of security to your online data storage with our SharePoint Online advanced scan API. Simply integrate our code into your environment & supply your API key to take advantage of continuously updated signatures for millions of security threats. Scan stored files for viruses & malware, executables, invalid files, scripts, and more, while customizing threat rules to your needs.
Below, you can use code from the Cloudmersive API Console page to connect your project in Go, or follow the link & navigate to the Virus Scan API page to select the programming language you need.
import (
"fmt"
"net/http"
"io/ioutil"
)func main() {url := "https://api.cloudmersive.com/virus/scan/cloud-storage/sharepoint-online/site/advanced"
method := "POST"client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)if err != nil {
fmt.Println(err)
return
}
req.Header.Add("clientID", "<string>")
req.Header.Add("clientSecret", "<string>")
req.Header.Add("sharepointDomainName", "<string>")
req.Header.Add("siteID", "<string>")
req.Header.Add("tenantID", "<string>")
req.Header.Add("filePath", "<string>")
req.Header.Add("itemID", "<string>")
req.Header.Add("allowExecutables", "<boolean>")
req.Header.Add("allowInvalidFiles", "<boolean>")
req.Header.Add("allowScripts", "<boolean>")
req.Header.Add("allowPasswordProtectedFiles", "<boolean>")
req.Header.Add("allowMacros", "<boolean>")
req.Header.Add("allowXmlExternalEntities", "<boolean>")
req.Header.Add("restrictFileTypes", "<string>")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Note that you’ll need an API key & secret key along with your SharePoint Domain Name to use this API. If you don’t currently have a Cloudmersive API key, you can get a free one easily by creating a free-tier account on our website (www.cloudmersive.com) with zero financial commitments.