API
/
Quickstart
API
/
Quickstart
API
/
Quickstart

API

Quickstart

Written by

Toni Barthel

Published

Oct 12, 2024

API

Quickstart

Written by

Toni Barthel

Published

Oct 12, 2024

API

Quickstart

Written by

Toni Barthel

Published

Oct 12, 2024

This guide will get you all set up and ready to use the 1Protection API. We'll cover how to get started and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.


Get your API Key

Before you can make requests to the 1Protection API, you will need to obtain your API key from your profile. You can find it under Your Profile » API Key. Afterward, add the API as an Integration to activate it by navigating to Add Integration » Select API. Finally, set up your first policy for scanning messages via Policies » Add Policy » Select API.


Check you environment

To work with the 1Protection API, you can use cURL to send HTTP requests. The following example demonstrates how to check if cURL is available on your client.

# cURL is most likely already installed on your machine
curl --version


Making your first API request

After verifying that cURL is installed, you are ready to make your first call to the 1Protection API. Below, you can see an example of how to send a POST request to the Scan endpoint to scan your first message.


Request

curl --request POST \
  --url 'https://api.1protection.ai/v1/scan' \
  --header "Authorization: Bearer {token}" \
  --header "Content-Type: application/json" \
  --data '
    {
      "policy": {
        "uuid": "{policy}"
      },
      "payload": "Hey team, just a reminder not to share the secret recipe for grandma's legendary cookies in public channels. We don't want our competitors baking their way to success!"
    }
    '


Repsonse

{
  "message": "no violation found"
}


Great, you’re now set up and have made your first scan request to the API. With just one simple POST request, you’ve experienced the ease and power of the 1Protection API.