SAFE-e
  • Welcome!
  • Quick Start
  • A complete integration
  • KNOWLEDGEBASE
    • Risk scoring
    • Signals
  • API Reference
Powered by GitBook
On this page
  • Get your API keys
  • Install and configure the library
  • Send a custom event
  • Viewing the result

Was this helpful?

Quick Start

Good to know: This QuickStart guide will help you get started with Safe-e by populating your environment with test data, allowing you to explore the basic concepts of users, risk scores, and behavioral signals.

Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You will receive your API key shortly after completing the registration in your registration email.

Install and configure the library

The best way to do the initial tests with our API is using simple requests, you can do this using any programming language that works with HTTP requests, in the example below we will use Python.

# Install via pip
pip install httpx


# Import httpx library
import httpx

# Define example data
example_data = {
	"type": "$login",
	"status": "$succeeded",
	"user_headers": {
		"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15",
		"host": "site.customer.com",
		"accept_language": "en-US",
		"accept_encoding": "gzip, deflate, br",
		"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
	},
	"product": "Safee-Login",
	"user": {
		"user_id": "098080381",
		"user_email": "user@customer.com",
		"user_ip": "156.146.48.12"
	}
}

# Define Headers
headers = {'Content-Type': 'application/json', 'Authorization-API': 'xxx.xxx.xxx.xxx'}

Good to know: Change the xxx.xxx.xxx.xxx to the API key you received after activating your account.

Send a custom event

Sending custom events is the first way for you to interact with the platform, viewing the result that presents the risk of the event that was sent.

# Make sample request
req = httpx.post('https://api.safe-e.com/api/v1/risk/login', headers=headers, json=example_data)

Viewing the result

As soon as the request is sent, the Safe-e engines analyze the context of the event sent and returns the Score with the possible risks and signals found.

{
	"risk": 25.0,
	"account_abuse": 33.75,
	"account_takeover": 27.75,
	"bot": 27.75,
	"signals": [
		"proxy_ip"
	],
	"policy": {
		"name": "Policy Default",
		"action": "Deny"
	}
}

Good to know: Now that you've done the simple integration test, we recommend reading the rest of the documentation to understand how the integration works.

PreviousWelcome!NextA complete integration

Last updated 2 years ago

Was this helpful?