Document


Getting Started

First, you will need api_key and secret_key. These API keys located in your account. You are required it when you want to use API key for interact with service.
Also you required to restrict API access to your own secure IP addresses. If you do not know your server's IPaddress, you can run this command on your server.

curl 'https://blacklist.wallet.ir/api/'


API Key Setup

First, get API key and secret key from panel and choose method's that you need.
Never share your API key/secret key to ANYONE.
API key and secret key will be something like this:

API Key: 4f3c12fa0a1d1ac8b026298b980f16b2
SECRET KEY: f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6
For each request you must send two params in header, one of this is api_key and another is api_sign you must create api_sign by hmac_hash sha256 on params that you will be sent!
for example: you want to send par1=value1 and par2=value2 to API
at the first you must create api_sign string by secret_key .

PHP:

$post_encode = http_build_query([
             'par1'=>'value1',
             'par2'=>'value2'
        ]);
$s = hash_hmac('sha256', $post_encode, 'f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6', true);
echo base64_encode($s); //g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=
    


Node.js:
var crypto = require('crypto');
var hash = crypto.createHmac('SHA256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").update("par1=value1&par2=value2").digest('base64');
    



Python:
import hashlib
import hmac
import base64

dataToBeSigned= bytes("par1=value1&par2=value2").encode('utf-8')
portalKey = bytes("f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").encode('utf-8')

signature = base64.b64encode(hmac.new(portalKey, dataToBeSigned, digestmod=hashlib.sha256).digest())
    


Ruby:
require 'openssl'
require "base64"

hash  = OpenSSL::HMAC.digest('sha256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6", "par1=value1&par2=value2")
token = Base64.encode64(hash)
token.delete("\n")
    


Java:
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;

public class ApiSecurityExample {
  public static void main(String[] args) {
    String portalKey = "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6";
    String dataToBeSigned= "par1=value1&par2=value2";

    Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
    SecretKeySpec secret_key = new SecretKeySpec(portalKey.getBytes(), "HmacSHA256");
    sha256_HMAC.init(secret_key);

    String hash = Base64.encodeBase64String(sha256_HMAC.doFinal(dataToBeSigned.getBytes()));
  }
}
    


Send request

At this level , you must have api_key and api_sign and params that you want to send par1=value1&par2=value2
send params via post method to API and set api_key and api_sign in header .

CURL

curl -H "api_key:4f3c12fa0a1d1ac8b026298b980f16b2" -H "api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=" --data "par1=value1&par2=value2" https://blacklist.wallet.ir/api/example

PHP
$_headers = [
	'api_key:4f3c12fa0a1d1ac8b026298b980f16b2',
	'api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $_headers);
curl_setopt($ch, CURLOPT_URL, 'https://blacklist.wallet.ir/api/example');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'par1=value1&par2=value2');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
        


Response

All response is json format .

Success Sample:

{
	...
	"success": true,
	"status": 200
}
    
success will be true if everything is fine and status is same as a http status code.

Failed Sample:
{
	"errors": {
		"auth": "INVALID_API_SIGN"
	},
	"success": false,
	"status": 403
}
    


General

POST https://blacklist.wallet.ir/api/general



Response:

{
    "reason_list": ["فیشینگ", "اجاره حساب ", "اجاره مدارک هویتی", "استعلام قضایی", "گزارش فتا", "شرطبندی", "اخاذی", "اجاره اکانت", "آگهی دیوار ", "آگهی شیپور", "آگهی کار در منزل", "سوددهی"],
    "type_list": ["guilty", "suspicious"],
    "label_list": ["national_code", "card", "iban", "account_number", "phone", "mobile", "email", "emoney_account", "crypto_wallet"]
}

    


Search

POST https://blacklist.wallet.ir/api/search

search string yes for example 09120000001
label string yes one of the label list in general api for example mobile


Response:
{
    "result": {
        "is_clear": false,
        "type_count": {
            "guilty": 1,
            "suspicious": 2
        },
        "details": [{
                "report_id": 27,
                "is_your_report": false,
                "date": "2024-01-31T12:03:40+00:00",
                "type": "guilty",
                "reason": "اجاره مدارک هویتی",
                "description": "این شماره موبایل ، حسابش رو اجاره میدهد"
            }, {
                "report_id": 28,
                "is_your_report": true,
                "date": "2024-01-31T12:04:07+00:00",
                "type": "suspicious",
                "reason": "آگهی شیپور",
                "description": "آگهی در شیپور ثبت کرده"
            }, {
                "report_id": 29,
                "is_your_report": true,
                "date": "2024-01-31T12:04:21+00:00",
                "type": "suspicious",
                "reason": "آگهی دیوار ",
                "description": "در دیوار آگهی ثبت کرده"
            }
        ]
    },
    "request": {
        "search": "09120000001",
        "label": "mobile"
    },
    "success": true,
    "status": 200
}

    


Add to blacklist

POST https://blacklist.wallet.ir/api/add-to-blacklist

Name Type Mandatory Description
reason string yes one of the reason list in general api for example سوددهی
type string yes one of the type list in general api for example guilty
description string no
national_code string no
card string no
iban string no
account_number string no
phone string no
mobile string no
email string no
emoney_account string no
crypto_wallet string no


Response:
{
    "result": true,
    "report_id": "32",
    "success": true,
    "status": 200
}

    

Remove From Blacklist

POST https://blacklist.wallet.ir/api/remove-from-blacklist

Name Type Mandatory Description
report_id integer yes


Response:
{
    "result": true,
    "report_id": "34",
    "success": true,
    "status": 200
}

    

Blacklist

POST https://blacklist.wallet.ir/api/blacklist

Name Type Mandatory Description
search string no
report_id integer no
page integer yes
limit integer yes min 1 , max 100


Response:
{
    "items": [ {
            "report_id": 37,
            "time": 1706703722,
            "date": "2024-01-31T12:22:02+00:00",
            "type": "suspicious",
            "reason": "اخاذی",
            "description": "test",
            "is_deleted": false,
            "deleted_time": null,
            "deleted_date": null,
            "details": {
                "card": "6104337800000000",
                "mobile": "09130000002"
            }
        }, {
            "report_id": 36,
            "time": 1706703721,
            "date": "2024-01-31T12:22:01+00:00",
            "type": "suspicious",
            "reason": "اخاذی",
            "description": "test",
            "is_deleted": false,
            "deleted_time": null,
            "deleted_date": null,
            "details": {
                "mobile": "09130000002"
            }
        }, {
            "report_id": 34,
            "time": 1706703690,
            "date": "2024-01-31T12:21:30+00:00",
            "type": "suspicious",
            "reason": "اخاذی",
            "description": "test",
            "is_deleted": true,
            "deleted_time": 1706707276,
            "deleted_date": "2024-01-31T13:21:16+00:00",
            "details": {
                "mobile": "09130000002"
            }
        }, {
            "report_id": 33,
            "time": 1706703676,
            "date": "2024-01-31T12:21:16+00:00",
            "type": "suspicious",
            "reason": "اخاذی",
            "description": "test",
            "is_deleted": false,
            "deleted_time": null,
            "deleted_date": null,
            "details": {
                "mobile": "09130000002"
            }
        }, {
            "report_id": 32,
            "time": 1706703674,
            "date": "2024-01-31T12:21:14+00:00",
            "type": "suspicious",
            "reason": "اخاذی",
            "description": "test",
            "is_deleted": false,
            "deleted_time": null,
            "deleted_date": null,
            "details": {
                "mobile": "09130000002"
            }
        }
    ],
    "total": 100,
    "limit": 5,
    "page": 1,
    "success": true,
    "status": 200
}