Quick Start
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": "[email protected]",
"user_ip": "156.146.48.12"
}
}
# Define Headers
headers = {'Content-Type': 'application/json', 'Authorization-API': 'xxx.xxx.xxx.xxx'}
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"
}
}
Last updated
Was this helpful?