> For the complete documentation index, see [llms.txt](https://insystech-dlp.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://insystech-dlp.gitbook.io/doc/quickstarts/json.md).

# Using a JSON request

This page shows you how to perform basic tasks in the Insystech Data Loss Prevention API by making calls directly to the API.

## Before you begin

To use the Insystech service you will need to subscribe to the Insystech DLP service.  If you have not yet subscribed please do that first and [sign up here](https://dlp.rpa.insystechinc.com/api/).  &#x20;

**Check your Inbox** for your subscription receipt, it will contain two important pieces of information that you'll need:  **APIKey** and **secret**

Also, you'll need to have a method to convert your file to a *base64string*  because REST API expects the request to contain the file in this format  &#x20;

{% tabs %}
{% tab title="JavaScript" %}

```javascript
var base64Img = require('base64-img');
objBase64 = base64Img.base64Sync("your file path").split(',')[1];

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.IO;

byte[] bytes; 
bytes = File.ReadAllBytes(filePath); 
var outputBase64 = Convert.ToBase64String(bytes);
```

{% endtab %}
{% endtabs %}

## Inspect a Microsoft Word document for sensitive information

This section shows you how to ask the service to scan a Microsoft Word Document using the `redact`REST method.

1. Create a JSON request file with the following text, and save it as `redact-request.json`.

   ```
   { 
     "redact":  {
       "redactType":"FILE",
       "sourceData":"{Your Base64string}",
       "sourceFileName":"sample-doc.docx",
       "detectors": [ ]
       }
   }
   ```

   This JSON request contains the [`redact`](/doc/apis-and-reference/method-redact.md) object. you received when subscribing to the Insystech DLP Service.   <br>
2. Create a JSON request file with the following text, and save it as `authentication-request.json`.

   ```
   { 
     "APIKey": "{Your API Key}",
     "secret": "{Your API Secret}"
   }
   ```

   This JSON request contains the `APIKey` and `secret` that you received when subscribing to the Insystech DLP Service.   <br>
3. Use `curl` to make an `authentication` request, passing it the filename of the JSON request you set up in step 2:

   ```
   curl -s \
   -H "Content-Type: application/json" \
   https://dlp.rpa.insystechinc.com/api/authentication \
   -d @authentication-request.json
   ```

   Note that to pass a filename to `curl` you use the `-d` option (for "data") and precede the filename with an `@` sign. This file should be in the same directory in which you execute the `curl` command.<br>
4. Use `curl` to make a `redaction` request, passing it the access token you received as a response in step 3 and the filename of the JSON request you set up in step 1:

   ```
   curl -o redacted-result.pdf -s \
   -H "TOKEN: {ACCESS_TOKEN}" \
   -H "Content-Type: application/json" \
   https://dlp.rpa.insystechinc.com/api/redact \
   -d @redact-request.json
   ```

   Note that receive the response as a file using`curl` you use the `-o` option (for "output") and precede the filename. This file should be in the same directory in which you execute the `curl` command.<br>
5. Insystech DLP responds to your request with a 400 status message and the redacted file saved to your computer.

**Congratulations!** Your Robot has redacted its first file with Insystech DLP!<br>
