Overview

Long story short - here is how Qrator API works:

POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Length: 38
Content-Type: application/json

{"method":"ping","params":null,"id":1}


HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Length: 38
Content-Type: application/json
X-Qrator-Auth: aabbccddeeff

{"method":"ping","params":null,"id":1}

HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}

API concept

Qrator API provides its interface as a JSON-RPC web service.

In order to forward your request to the Qrator API, create a HTTP POST request to api.qrator.net.

It is possible to use plain TCP connection, but using SSL connection is preferred for security reasons.

Currently Qrator API uses JSON-RPC 1.0.

In case you don't use any library to form request for you - make sure that you request is HTTP/1.0 or HTTP/1.1 compliant.

All provided examples use HTTP/1.0, you are free to do same way or use HTTP/1.1 with Connection: keepalive.

Version

Current version of Qrator API is 1.0.19

Qrator API retains backward compatability witah all previous versions.

Authorization

IP-Auth

Qrator API uses authorization based on source IP addresses of API call. To gain access to Qrator API you should create new ticket at personal dashboard this request to add your IP address to trusted IP list.

During actual Qrator API call you don't need to do anything about authorization.

Token-Auth

Qrator API also enables token-based authorization. This method is intended to eventually replace the older IP-based authorization, works independently and does not require the former auth method to work for the client who has chosen to use the new one.

In order to enable this method you need to acquire an access token from the personal dashboard. This token may grant permission to call different API methods according to selected settings:

  • Domain methods for a specific domain
  • Domain methods for all domain and client methods

The token is transmitted in a HTTP header X-Qrator-Auth field of the API call. Please take note that token-based authorization works only when HTTPS/TLS/SSL is used to access Qrator API. Should the token be passed in plain HTTP or be absent in the request, the security check reverts back to IP-based authorization method for the sake of backwards compatibility.

Data types

ContactList

Added in v 1.0.15

List of contacts registered at Qrator personal dashboard

[
    {
        "id": 1,
        "email": "john@example.com",
        "first_name": "John",
        "middle_name": "Random",
        "last_name": "User",
        "role": {
            "tech": false,
            "finance": true,
            "administrative": true
        }
    }
]

DomainList

Added in v 1.0.4

List of domains and services (see also UpstreamConfiguration and ServicePorts):

{
    "result": [
        {
            "id": 1,
            "name": "example.com",
            "status": "online",
            "ip": [
                "198.51.100.12"
            ],
            "ip_json": {
                "balancer": "roundrobin",
                "weights": false,
                "backups": false,
                "upstreams": [
                    {
                        "type": "primary",
                        "ip": "192.0.2.7",
                        "weight": 0,
                        "name": ""
                    },
                    {
                        "type": "primary",
                        "ip": "192.0.2.1",
                        "weight": 1,
                        "name": "some name just for you"
                    },
                    {
                        "type": "primary",
                        "ip": "198.51.100.12",
                        "weight": 1,
                        "name": "test"
                    }
                ]
            },
            "qratorIp": "203.0.113.1",
            "isService": false,
            "ports": null
        },
        {
            "id": 2,
            "name": "text.example.com",
            "status": "online",
            "ip": [
                "178.248.232.2"
            ],
            "ip_json": [
                "198.51.100.12"
            ],
            "qratorIp": "service",
            "isService": true,
            "ports": {
                "80": "http",
                "443": "http",
                "53": "dns",
                "79": [
                    "tcp",
                    "udp"
                ]
            }
        }
    ],
    "error": null,
    "id": 1
}

Field "ports" will allways be null for domains and ServicePorts for services.

Field "ip_json" will allways be object for domains and list for services.

Enum

An enumeration is a distinct type whose value is restricted to a range of values.

For example - see domain_status_get

IP

String representation of IPv4 address, for example: "192.0.2.1"

{
    "method": "method_name",
    "params": [
        "192.0.2.1"
    ],
    "id": 1
}

IPList

List of IPs.

See domain method test_iplist, that helps to with formatting parameters of this type.

{
    "method": "method_name",
    "params": [
        [
            "192.0.2.1"
        ],
        [
            "198.51.100.12"
        ]
    ],
    "id": 1
}

NetworkList

Added in v 1.0.10

List of IP/mask networks

[
    "192.0.2.1\/32",
    "198.51.100.0\/24"
]

Number

Just a number huh ;)

Prefix

Ordinary string representation. For example, "127.255.0.0/24"

{
    "method": "method_name",
    "params": [
        "127.255.0.0\/24"
    ],
    "id": 1
}

PrefixList

List of prefixes with announce statuses:

{
    "result": [
        {
            "announce": "offline",
            "prefix": "178.248.232.0\/23"
        },
        {
            "announce": "offline",
            "prefix": "178.248.232.0\/24"
        }
    ],
    "error": null,
    "id": 1
}

RequestSuccess

Subtype of String with a single possible value: Successful.

{
    "result": "Successful",
    "error": null,
    "id": 1
}

ServicePorts

Added in v 1.0.11

Set of numeric ports and ServiceProto

{
    "method": "<method name>",
    "params": {
        "80": "http",
        "443": "http",
        "53": "dns",
        "79": [
            "tcp",
            "udp"
        ]
    },
    "id": 1
}

Please note: possible port number values are 1-65535.

As you can see in example above, protos can be specified as list.

Only following values of ServiceProto are valid:

  • ["http"]
  • ["tcp"]
  • ["udp"]
  • ["dns"]
  • ["tcp","udp"]

When supplied single ServiceProto it could be used either as a String or as a List

ServiceProto

Added in v 1.0.11

String representation of service protocol, current supported protocols:

  • http
  • tcp
  • udp
  • udp
  • dns

StatisticsResponse

Object, representing latest statistics snapshot, with following fields:

{
    "result": {
        "time": 1469998800,  // timestamp for snapshot
        "bsend": 0,          // bypassed traffic (bps)
        "brecv": 0,          // incoming traffic (bps)
        "bout": 0,           // outgoing traffic (bps)
        "psend": 0,          // bypassed packets (pps)
        "precv": 0,          // incoming packets (pps)
        "reqspeed": 0,       // request rate(rps)
        "reqlonger10s": 0,   // number of responses having response time > 1.0s
        "reqlonger07s": 0,   // number of responses having response time > 0.7s
        "reqlonger05s": 0,   // number of responses having response time > 0.5s
        "reqlonger02s": 0,   // number of responses having response time > 0.2s
        "reqall": 0,         // total number of responses
        "err50x": 0,         // number of HTTP 50X errors
        "err501": 0,         // number of HTTP 501 errors
        "err502": 0,         // number of HTTP 502 errors
        "err503": 0,         // number of HTTP 503 errors
        "err504": 0,         // number of HTTP 504 errors
        "ban": 0,            // number of IPs banned by Qrator
        "ban_api": 0,        // number of IPs banned by client via Qrator.API
        "ban_waf": 0,        // number of IPs banned by WAF
        "ban_geo": {},       // an object containing countries with number of banned IPs
        "billable": 0        // billable traffic (Mbps)
    },
    "error": null,
    "id: 1
}

ban_geo - for this dictionary, keys are 2-letter strings representing ISO 3166-1 alpha-2 country code, and values are the count of IP addresses banned for the corresponding country

StatisticsResponseLite

Object, representing latest lite statistics snapshot (without "billable"), with following fields:

{
    "result": {
        "time": 1469998800,  // timestamp for snapshot
        "bsend": 0,          // bypassed traffic (bps)
        "brecv": 0,          // incoming traffic (bps)
        "bout": 0,           // outgoing traffic (bps)
        "psend": 0,          // bypassed packets (pps)
        "precv": 0,          // incoming packets (pps)
        "reqspeed": 0,       // request rate(rps)
        "reqlonger10s": 0,   // number of responses having response time > 1.0s
        "reqlonger07s": 0,   // number of responses having response time > 0.7s
        "reqlonger05s": 0,   // number of responses having response time > 0.5s
        "reqlonger02s": 0,   // number of responses having response time > 0.2s
        "reqall": 0,         // total number of responses
        "err50x": 0,         // number of HTTP 50X errors
        "err501": 0,         // number of HTTP 501 errors
        "err502": 0,         // number of HTTP 502 errors
        "err503": 0,         // number of HTTP 503 errors
        "err504": 0,         // number of HTTP 504 errors
        "ban": 0,            // number of IPs banned by Qrator
        "ban_api": 0,        // number of IPs banned by client via Qrator.API
        "ban_waf": 0,        // number of IPs banned by WAF
        "ban_geo": {}        // an object containing countries with number of banned IPs
    },
    "error": null,
    "id: 1
}

ban_geo - for this dictionary, keys are 2-letter strings representing ISO 3166-1 alpha-2 country code, and values are the count of IP addresses banned for the corresponding country

String

Just string, used in methods like ping or troubleshoot_traceroute.

{
    "result": "pong",
    "error": null,
    "id": 1
}

TimedIP

Added in v 1.0.3

Couple of IP, represented by string, and time (seconds), represented by non negative number:

[
    "192.0.2.1",
    300
]

0 as "time" parameter will be interpreted as infinity

Currently Qrator API doesn't use TimedIP directly, please see TimedIPList.

TimedIPList

Added in v 1.0.3

List of TimedIPs

See domain method test_timediplist, that helps to with formatting parameters of this type.

{
    "method": "method_name",
    "params": [
        [
            "192.0.2.1",
            300
        ],
        [
            "198.51.100.12",
            720
        ]
    ],
    "id": 1
}

This type is compatible to IPList and you can even mix IP and TimedIP, but only for method that accepts TimedIPList:

{
    "method": "method_name",
    "params": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "id": 1
}

UpstreamConfiguration

Added in v 1.0.5

Object representing upstream configuration

{
    "method": "method_name",
    "params": {
        "balancer": "roundrobin",
        "weights": false,
        "backups": false,
        "upstreams": [
            {
                "type": "primary",
                "ip": "192.0.2.7",
                "weight": 0,
                "name": ""
            },
            {
                "type": "primary",
                "ip": "192.0.2.1",
                "weight": 1,
                "name": "some name just for you"
            },
            {
                "type": "primary",
                "ip": "198.51.100.12",
                "weight": 1,
                "name": "test"
            }
        ]
    },
    "id": 1
}

UpstreamTestResult

Validation result for upstream for IPList:

{
    "result": {
        "error": null,
        "warning": [],
        "object": [
            [
                "192.0.2.1",
                "198.51.100.12"
            ]
        ]
    },
    "error": null,
    "id": 1
}

Validation result for upstream for UpstreamConfiguration:

{
    "result": {
        "error": null,
        "warning": [],
        "object": {
            "balancer": "roundrobin",
            "weights": false,
            "backups": false,
            "upstreams": [
                {
                    "type": "primary",
                    "ip": "192.0.2.7",
                    "weight": 0,
                    "name": ""
                },
                {
                    "type": "primary",
                    "ip": "192.0.2.1",
                    "weight": 1,
                    "name": "some name just for you"
                },
                {
                    "type": "primary",
                    "ip": "198.51.100.12",
                    "weight": 1,
                    "name": "test"
                }
            ]
        }
    },
    "error": null,
    "id": 1
}

Errors

Error reasons

Error reasons are Strings from this list:

BadRequest

Most common problems - malformed HTTP-request:

  • missing entity id
  • missing or malformed Content-Type header
  • missing or malformed Content-Length header
  • malformed JSON
{
    "result": null,
    "error": "BadRequest",
    "id": 1
}

UnknownMethod

Most common problems:

  • misspelling method name - all Qrator API method are lowercase with underscore
  • wrong call mode name - per-client method cannot be called in per-domain mode
{
    "result": null,
    "error": "UnknownMethod",
    "id": 1
}

BadArguments

There are many reasons for request to return BadArguments error, but 99.99% of them can be fixed by dumping your request and recheck method parameter types.

{
    "result": null,
    "error": "BadArguments",
    "id": 1
}

For example, it is very easy to miss the difference between IPList (with a single IP address) and IP.

// IPList:
{
    "method": "METHOD_NAME",
    "params": [["192.0.2.1"]],
    "id": 1
}
// versus
// IP:
{
    "method": "METHOD_NAME",
    "params": ["192.0.2.1"],
    "id": 1
}

SystemFailure

This error response means that Qrator API couldn't perform your request for some internal reason.

{
    "result": null,
    "error": "SystemFailure",
    "id": 1
}

ACLException

This error response means access if forbidden.

{
    "result": null,
    "error": "ACLException",
    "id": 1
}

Additional headers

To make debugging a little bit easier Qrator API responds with some additional headers, so you can see how Qrator API understands your request:

HTTP/1.1 200 OK
Server: QRATOR
Content-Type: application/json
X-Qrator-API-IP: 192.0.2.1 // calling IP address (string)
X-Qrator-API-SRV: ok       // request type parser status (string: ok | fail)
X-Qrator-API-Mode: domain  // method mode (string: domain | client)
X-Qrator-API-ID: 1         // entity ID from URI (int)

<response body>

Debug methods

Base URI

https://api.qrator.net/request/debug/

Note: Debug methods doesn't use authorization and there is no any entity ID in URI.

Troubleshoot

ping

Dummy method used to check that your request is OK and API is sane.

Added

v1.0.12

Parameters

None

Return Values

String "pong"

Example

Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38

{"method":"ping","params":null,"id":1}
Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38
X-Qrator-Auth: aabbccddeeff

{"method":"ping","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
{"result":"pong","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}

Test

test_iplist

Test given IP addresses to be valid .

Added

v1.0.12

Parameters

IPList

Return Values

IPList

Example

Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70

{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70
X-Qrator-Auth: aabbccddeeff

{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 60

{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' \
  --post-data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' \
  --data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        "198.51.100.12"
    ],
    "error": null,
    "id": 1
}

test_timediplist

Test given IP addresses to be valid .

Added

v1.0.12

Parameters

TimedIPList

Return Values

TimedIPList

Example

Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 80

{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 80
X-Qrator-Auth: aabbccddeeff

{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 69

{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' \
  --post-data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' \
  --data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}'
Copy
{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
{
    "result": [
        [
            "192.0.2.1",
            80
        ],
        [
            "198.51.100.12",
            0
        ]
    ],
    "error": null,
    "id": 1
}

test_upstreamlist

Test given IP addresses to be valid and it could be used as domain/service upstream.

Added

v1.0.12

Parameters

IPList

Return Values

IPList

Example

Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76

{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76
X-Qrator-Auth: aabbccddeeff

{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 60

{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' \
  --post-data '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' \
  --data '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        "198.51.100.12"
    ],
    "error": null,
    "id": 1
}

service_ports_test

Tests given set to be valid.

Added

v1.0.12

Parameters

ServicePorts

Return Values

ServicePorts

Example

Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 110

{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
POST /request/debug/ HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 110
X-Qrator-Auth: aabbccddeeff

{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 93

{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/debug/ \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
$ curl https://api.qrator.net/request/debug/ \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
{
    "result": {
        "22": [
            "tcp"
        ],
        "53": [
            "tcp",
            "udp"
        ],
        "80": [
            "http"
        ],
        "443": [
            "http"
        ]
    },
    "error": null,
    "id": 1
}

Client methods

Base URI

https://api.qrator.net/request/client/<client_id>

ID of client may be obtained in personal dashboard - it's "cl0000" thing at the very top of the page. Make sure to use only number in your Qrator API calls.

Domains

domains_get

Returns list of your domains and services.

Added

v1.0.4

Parameters

None

Return Values

DomainList

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 45

{"method":"domains_get","params":null,"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 45
X-Qrator-Auth: aabbccddeeff

{"method":"domains_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 260

{"result":[{"id":1,"name":"example.com","status":"online","ip":["127.255.255.254"],"qratorIp":"178.248.232.1","isService":false},{"id":2,"name":"text.example.com","status":"online","ip":["127.0.0.1"],"qratorIp":"service","isService":true}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domains_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domains_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"id":1,"name":"example.com","status":"online","ip":["127.255.255.254"],"qratorIp":"178.248.232.1","isService":false},{"id":2,"name":"text.example.com","status":"online","ip":["127.0.0.1"],"qratorIp":"service","isService":true}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domains_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domains_get","params":null,"id":1}'
Copy
{"result":[{"id":1,"name":"example.com","status":"online","ip":["127.255.255.254"],"qratorIp":"178.248.232.1","isService":false},{"id":2,"name":"text.example.com","status":"online","ip":["127.0.0.1"],"qratorIp":"service","isService":true}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 1,
            "name": "example.com",
            "status": "online",
            "ip": [
                "127.255.255.254"
            ],
            "qratorIp": "178.248.232.1",
            "isService": false
        },
        {
            "id": 2,
            "name": "text.example.com",
            "status": "online",
            "ip": [
                "127.0.0.1"
            ],
            "qratorIp": "service",
            "isService": true
        }
    ],
    "error": null,
    "id": 1
}

Prefixes

prefix_list

Returns list of your prefixes.

Parameters

None

Return Values

PrefixList

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 45

{"method":"prefix_list","params":null,"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 45
X-Qrator-Auth: aabbccddeeff

{"method":"prefix_list","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 136

{"result":[{"announce":"offline","prefix":"178.248.232.0\/23"},{"announce":"offline","prefix":"178.248.232.0\/24"}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"prefix_list","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"prefix_list","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"announce":"offline","prefix":"178.248.232.0\/23"},{"announce":"offline","prefix":"178.248.232.0\/24"}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"prefix_list","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"prefix_list","params":null,"id":1}'
Copy
{"result":[{"announce":"offline","prefix":"178.248.232.0\/23"},{"announce":"offline","prefix":"178.248.232.0\/24"}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "announce": "offline",
            "prefix": "178.248.232.0\/23"
        },
        {
            "announce": "offline",
            "prefix": "178.248.232.0\/24"
        }
    ],
    "error": null,
    "id": 1
}

prefix_announce_status

Returns announce status of given prefix.

Parameters

Prefix

Return Values

Enum with value from following list:

  • online: prefix is announcing
  • offline: prefix not announcing
  • pending: some operations are performed on the prefix
  • error: previous operation failed

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 73

{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 73
X-Qrator-Auth: aabbccddeeff

{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 40

{"result":"offline","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
{"result":"offline","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"prefix_announce_status","params":["178.248.232.0\/23"],"id":1}'
Copy
{"result":"offline","error":null,"id":1}
Copy
{
    "result": "offline",
    "error": null,
    "id": 1
}

prefix_announce_on

Turns prefix announcing on.

Parameters

Prefix

Return Values

RequestSuccess

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 69

{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 69
X-Qrator-Auth: aabbccddeeff

{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"prefix_announce_on","params":["178.248.232.0\/23"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

prefix_announce_off

Turns prefix announcing off.

Parameters

Prefix

Return Values

RequestSuccess

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70

{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70
X-Qrator-Auth: aabbccddeeff

{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"prefix_announce_off","params":["178.248.232.0\/23"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Blacklist

blacklist_check

Checks if given IP address is blacklisted or not for active domains and services.

Added

v1.0.13

Parameters

IP

Return Values

Enum with value from following list:

  • Banned: given IP address is blacklisted
  • NotBanned: given IP address is not blacklisted

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 61

{"result":{"1":"Banned","2":"NotBanned"},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":{"1":"Banned","2":"NotBanned"},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
{"result":{"1":"Banned","2":"NotBanned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "Banned",
        "2": "NotBanned"
    },
    "error": null,
    "id": 1
}

blacklist_status

Checks if given IP address is blacklisted or not, if it is - return reason, for active domains and services.

Added

v1.0.13

Parameters

IP

Return Values

Enum with value from following list:

  • NotBanned: IP address is not blacklisted by Qrator, API, client or WAF
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 59

{"result":{"1":"HTTP","2":"NotBanned"},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":{"1":"HTTP","2":"NotBanned"},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
{"result":{"1":"HTTP","2":"NotBanned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "HTTP",
        "2": "NotBanned"
    },
    "error": null,
    "id": 1
}

Contacts

contacts_get

Returns list of contacts registered at Qrator personal dashboard

Added

v1.0.15

Parameters

None

Return Values

ContactList

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 46

{"method":"contacts_get","params":null,"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 46
X-Qrator-Auth: aabbccddeeff

{"method":"contacts_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 189

{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"tech":false,"finance":true,"administrative":true}}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"contacts_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"contacts_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"tech":false,"finance":true,"administrative":true}}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"contacts_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"contacts_get","params":null,"id":1}'
Copy
{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"tech":false,"finance":true,"administrative":true}}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 1,
            "email": "john@example.com",
            "first_name": "John",
            "middle_name": "Random",
            "last_name": "User",
            "role": {
                "tech": false,
                "finance": true,
                "administrative": true
            }
        }
    ],
    "error": null,
    "id": 1
}

Troubleshoot

ip_status

Checks status of given IP address for active domains and services.

Added

v1.0.13

Parameters

IP

Return Values

Enum with value from following list:

  • Upstream: IP address is one of the upstreams IPs
  • Whitelisted: IP address is whitelisted
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF
  • Allowed: IP address is is neither upstream nor the whitelisted, nor the blacklisted

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 54

{"method":"ip_status","params":"198.51.100.12","id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 54
X-Qrator-Auth: aabbccddeeff

{"method":"ip_status","params":"198.51.100.12","id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 59

{"result":{"1":"Allowed","2":"Banned"},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ip_status","params":"198.51.100.12","id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ip_status","params":"198.51.100.12","id":1}' --quiet -O -
Copy
{"result":{"1":"Allowed","2":"Banned"},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ip_status","params":"198.51.100.12","id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ip_status","params":"198.51.100.12","id":1}'
Copy
{"result":{"1":"Allowed","2":"Banned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "Allowed",
        "2": "Banned"
    },
    "error": null,
    "id": 1
}

source_ips_get

Returns list networks Qrator uses to access your servers

Added

v1.0.10

Parameters

None

Return Values

NetworkList

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48

{"method":"source_ips_get","params":null,"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48
X-Qrator-Auth: aabbccddeeff

{"method":"source_ips_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 67

{"result":["192.0.2.1\/32","198.51.100.0\/24"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"source_ips_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"source_ips_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1\/32","198.51.100.0\/24"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"source_ips_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"source_ips_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1\/32","198.51.100.0\/24"],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1\/32",
        "198.51.100.0\/24"
    ],
    "error": null,
    "id": 1
}

ping

Dummy method used to check that your request is OK and API is sane.

Parameters

None

Return Values

String "pong"

Example

Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38

{"method":"ping","params":null,"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38
X-Qrator-Auth: aabbccddeeff

{"method":"ping","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
{"result":"pong","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}

Domain methods

Base URI

https://api.qrator.net/request/domain/<domain_id>

ID of domain may be obtained in personal dashboard at domains control

section- it's "d0000" thing besides domain name. Make sure to use only number in your Qrator API calls.

Domain Status

domain_status_get

Returns current domain status.

Parameters

None

Return Values

Enum with value from following list:

  • offline: domain is offline
  • online: domain is online
  • pending: some operations are performed on the domain
  • error: previous operation failed

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 51

{"method":"domain_status_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 51
X-Qrator-Auth: aabbccddeeff

{"method":"domain_status_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 39

{"result":"online","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_status_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_status_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"online","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_status_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_status_get","params":null,"id":1}'
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}

domain_name_get

Returns current domain status.

Parameters

None

Return Values

String

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49

{"method":"domain_name_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49
X-Qrator-Auth: aabbccddeeff

{"method":"domain_name_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 44

{"result":"example.com","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_name_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_name_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"example.com","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_name_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_name_get","params":null,"id":1}'
Copy
{"result":"example.com","error":null,"id":1}
Copy
{
    "result": "example.com",
    "error": null,
    "id": 1
}

Domain IP

domain_ip_get

Returns current upstreams IPs as JSON configuration.

name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]}

Parameters

None

Return Values

UpstreamConfiguration

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47

{"method":"domain_ip_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47
X-Qrator-Auth: aabbccddeeff

{"method":"domain_ip_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 255

{"result":"{\"balancer\":\"roundrobin\",\"weights\":false,\"backups\":false,\"upstreams\":[{\"type\":\"primary\",\"ip\":\"127.0.0.2\",\"weight\":0,\"name\":\"\"},{\"type\":\"primary\",\"ip\":\"127.0.0.1\",\"weight\":1,\"name\":\"some","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_ip_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_ip_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"{\"balancer\":\"roundrobin\",\"weights\":false,\"backups\":false,\"upstreams\":[{\"type\":\"primary\",\"ip\":\"127.0.0.2\",\"weight\":0,\"name\":\"\"},{\"type\":\"primary\",\"ip\":\"127.0.0.1\",\"weight\":1,\"name\":\"some","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_ip_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_ip_get","params":null,"id":1}'
Copy
{"result":"{\"balancer\":\"roundrobin\",\"weights\":false,\"backups\":false,\"upstreams\":[{\"type\":\"primary\",\"ip\":\"127.0.0.2\",\"weight\":0,\"name\":\"\"},{\"type\":\"primary\",\"ip\":\"127.0.0.1\",\"weight\":1,\"name\":\"some","error":null,"id":1}
Copy
{
    "result": "{\"balancer\":\"roundrobin\",\"weights\":false,\"backups\":false,\"upstreams\":[{\"type\":\"primary\",\"ip\":\"127.0.0.2\",\"weight\":0,\"name\":\"\"},{\"type\":\"primary\",\"ip\":\"127.0.0.1\",\"weight\":1,\"name\":\"some",
    "error": null,
    "id": 1
}

domain_ip_get_list

Returns current upstreams IPs as simple list.

Parameters

None

Return Values

IPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 52

{"method":"domain_ip_get_list","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 52
X-Qrator-Auth: aabbccddeeff

{"method":"domain_ip_get_list","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 62

{"result":["127.0.0.1","127.255.255.254"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_ip_get_list","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_ip_get_list","params":null,"id":1}' --quiet -O -
Copy
{"result":["127.0.0.1","127.255.255.254"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_ip_get_list","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_ip_get_list","params":null,"id":1}'
Copy
{"result":["127.0.0.1","127.255.255.254"],"error":null,"id":1}
Copy
{
    "result": [
        "127.0.0.1",
        "127.255.255.254"
    ],
    "error": null,
    "id": 1
}

domain_ip_test

Tests given parameters to be valid.

Parameters

IPList or UpstreamConfiguration

Return Values

UpstreamTestResult

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75

{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75
X-Qrator-Auth: aabbccddeeff

{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 99

{"result":{"error":null,"warning":[],"object":["127.0.0.1","127.255.255.254"]},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}' --quiet -O -
Copy
{"result":{"error":null,"warning":[],"object":["127.0.0.1","127.255.255.254"]},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}'
Copy
{"result":{"error":null,"warning":[],"object":["127.0.0.1","127.255.255.254"]},"error":null,"id":1}
Copy
{
    "result": {
        "error": null,
        "warning": [],
        "object": [
            "127.0.0.1",
            "127.255.255.254"
        ]
    },
    "error": null,
    "id": 1
}

domain_ip_set

Sets domains upstream IPs or configuration.

Parameters

IPList or UpstreamConfiguration

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 74

{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 74
X-Qrator-Auth: aabbccddeeff

{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Whitelist

whitelist_get

Returns domains whitelist contents.

Parameters

None

Return Values

IPList or TimedIPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47

{"method":"whitelist_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66

{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "error": null,
    "id": 1
}

whitelist_append

Added given IP addresses to domains whitelist.

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

whitelist_remove

Removes given IP addresses from domains whitelist.

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75

{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Whitequeue

whitequeue_get

Returns whitequeue contents.

Please note: time-part of result is a epoch time of adding IP to whitequeue

Parameters

None

Return Values

TimedIPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48

{"method":"whitequeue_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 86

{"result":[["192.0.2.1",1469998800],["198.51.100.12",1469998800]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[["192.0.2.1",1469998800],["198.51.100.12",1469998800]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_get","params":null,"id":1}'
Copy
{"result":[["192.0.2.1",1469998800],["198.51.100.12",1469998800]],"error":null,"id":1}
Copy
{
    "result": [
        [
            "192.0.2.1",
            1469998800
        ],
        [
            "198.51.100.12",
            1469998800
        ]
    ],
    "error": null,
    "id": 1
}

whitequeue_get_size

Returns count of IP addresses in whitequeue.

Parameters

None

Return Values

Number

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 53

{"method":"whitequeue_get_size","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 53
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_get_size","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 32

{"result":2,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_get_size","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_get_size","params":null,"id":1}' --quiet -O -
Copy
{"result":2,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_get_size","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_get_size","params":null,"id":1}'
Copy
{"result":2,"error":null,"id":1}
Copy
{
    "result": 2,
    "error": null,
    "id": 1
}

whitequeue_get_max_size

Returns maximum whitequeue size.

Parameters

None

Return Values

Number

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57

{"method":"whitequeue_get_max_size","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_get_max_size","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 32

{"result":2,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_get_max_size","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_get_max_size","params":null,"id":1}' --quiet -O -
Copy
{"result":2,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_get_max_size","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_get_max_size","params":null,"id":1}'
Copy
{"result":2,"error":null,"id":1}
Copy
{
    "result": 2,
    "error": null,
    "id": 1
}

whitequeue_set_max_size

Updates whitequeue maximum size to given number

Parameters

Number

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57

{"method":"whitequeue_set_max_size","params":1000,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_set_max_size","params":1000,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_set_max_size","params":1000,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_set_max_size","params":1000,"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_set_max_size","params":1000,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_set_max_size","params":1000,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

whitequeue_append

Added given IP addresses to domains whitequeue.

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76

{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_append","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

whitequeue_remove

Removes given IP addresses from domains whitequeue.

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76

{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 76
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

whitequeue_flush

Removes from whitequeue all IP addresses

Parameters

None

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 50

{"method":"whitequeue_flush","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 50
X-Qrator-Auth: aabbccddeeff

{"method":"whitequeue_flush","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitequeue_flush","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitequeue_flush","params":null,"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitequeue_flush","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitequeue_flush","params":null,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Blacklist

blacklist_get

Returns domains blacklist contents.

Added

v1.0.19

Parameters

None

Return Values

TimedIPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47

{"method":"blacklist_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66

{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "error": null,
    "id": 1
}

blacklist_append

Added given IP addresses to domains blacklist.

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_remove

Removes given IP addresses from domains blacklist.

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75

{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_flush

Removes from blacklist all IP addresses, that been added using Qrator API

Parameters

None

Return Values

RequestSuccess

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49

{"method":"blacklist_flush","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_flush","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_flush","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_flush","params":null,"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_flush","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_flush","params":null,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_check

Checks if given IP address is blacklisted or not.

Parameters

IP

Return Values

Enum with value from following list:

  • Banned: given IP address is blacklisted
  • NotBanned: given IP address is not blacklisted

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 42

{"result":"NotBanned","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}

blacklist_status

Checks if given IP address is blacklisted or not, if it is - return reason.

Added

v1.0.2

Parameters

IP

Return Values

Enum with value from following list:

  • NotBanned: IP address is not blacklisted by Qrator, API, client or WAF
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 42

{"result":"NotBanned","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}

Statistics

statistics_get

Returns latest statistics snapshot.

Parameters

None

Return Values

StatisticsResponse

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48

{"method":"statistics_get","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48
X-Qrator-Auth: aabbccddeeff

{"method":"statistics_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 310

{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1},"billable":0},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"statistics_get","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1},"billable":0},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"statistics_get","params":null,"id":1}'
Copy
{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1},"billable":0},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1469998800,
        "bsend": 0,
        "brecv": 0,
        "bout": 0,
        "psend": 0,
        "precv": 0,
        "reqspeed": 0,
        "reqlonger10s": 0,
        "reqlonger07s": 0,
        "reqlonger05s": 0,
        "reqlonger02s": 0,
        "reqall": 0,
        "err50x": 0,
        "err501": 0,
        "err502": 0,
        "err503": 0,
        "err504": 0,
        "ban": 0,
        "ban_api": 0,
        "ban_waf": 0,
        "ban_geo": {
            "RU": 1
        },
        "billable": 0
    },
    "error": null,
    "id": 1
}

statistics_get_lite

Returns latest lite statistics (without "billable") snapshot.

Parameters

None

Return Values

StatisticsResponseLite

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 53

{"method":"statistics_get_lite","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 53
X-Qrator-Auth: aabbccddeeff

{"method":"statistics_get_lite","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 297

{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_get_lite","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"statistics_get_lite","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_get_lite","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"statistics_get_lite","params":null,"id":1}'
Copy
{"result":{"time":1469998800,"bsend":0,"brecv":0,"bout":0,"psend":0,"precv":0,"reqspeed":0,"reqlonger10s":0,"reqlonger07s":0,"reqlonger05s":0,"reqlonger02s":0,"reqall":0,"err50x":0,"err501":0,"err502":0,"err503":0,"err504":0,"ban":0,"ban_api":0,"ban_waf":0,"ban_geo":{"RU":1}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1469998800,
        "bsend": 0,
        "brecv": 0,
        "bout": 0,
        "psend": 0,
        "precv": 0,
        "reqspeed": 0,
        "reqlonger10s": 0,
        "reqlonger07s": 0,
        "reqlonger05s": 0,
        "reqlonger02s": 0,
        "reqall": 0,
        "err50x": 0,
        "err501": 0,
        "err502": 0,
        "err503": 0,
        "err504": 0,
        "ban": 0,
        "ban_api": 0,
        "ban_waf": 0,
        "ban_geo": {
            "RU": 1
        }
    },
    "error": null,
    "id": 1
}

Troubleshoot

ping

Dummy method used to check that your request is OK and API is sane.

Parameters

None

Return Values

String "pong"

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38

{"method":"ping","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38
X-Qrator-Auth: aabbccddeeff

{"method":"ping","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
{"result":"pong","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}

ip_status

Checks status of given IP address.

Added

v1.0.7

Parameters

IP

Return Values

Enum with value from following list:

  • Upstream: IP address is one of the upstreams IPs
  • Whitelisted: IP address is whitelisted
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF
  • Allowed: IP address is is neither upstream nor the whitelisted, nor the blacklisted

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 56

{"method":"ip_status","params":["198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 56
X-Qrator-Auth: aabbccddeeff

{"method":"ip_status","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 40

{"result":"Allowed","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ip_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ip_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Allowed","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ip_status","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ip_status","params":["198.51.100.12"],"id":1}'
Copy
{"result":"Allowed","error":null,"id":1}
Copy
{
    "result": "Allowed",
    "error": null,
    "id": 1
}

troubleshoot_traceroute

Performs TCP traceroute to specified IP from active Qrator nodes.

Only active domain's upstream IP addresses allowed to be used with this method.

Parameters

IP

Return Values

String

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57

{"method":"troubleshoot_traceroute","params":null,"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 57
X-Qrator-Auth: aabbccddeeff

{"method":"troubleshoot_traceroute","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 61

{"result":"... a lot of trace lines ...","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"troubleshoot_traceroute","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"troubleshoot_traceroute","params":null,"id":1}' --quiet -O -
Copy
{"result":"... a lot of trace lines ...","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"troubleshoot_traceroute","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"troubleshoot_traceroute","params":null,"id":1}'
Copy
{"result":"... a lot of trace lines ...","error":null,"id":1}
Copy
{
    "result": "... a lot of trace lines ...",
    "error": null,
    "id": 1
}

test_iplist

Test given IP addresses to be valid .

Added

v1.0.8

Parameters

IPList

Return Values

IPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70

{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 70
X-Qrator-Auth: aabbccddeeff

{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 60

{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        "198.51.100.12"
    ],
    "error": null,
    "id": 1
}

test_timediplist

Test given IP addresses to be valid .

Added

v1.0.8

Parameters

TimedIPList

Return Values

TimedIPList

Example

Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 80

{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 80
X-Qrator-Auth: aabbccddeeff

{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 69

{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}'
Copy
{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":null,"id":1}
Copy
{
    "result": [
        [
            "192.0.2.1",
            80
        ],
        [
            "198.51.100.12",
            0
        ]
    ],
    "error": null,
    "id": 1
}

Service methods

Base URI

https://api.qrator.net/request/service/<service_id>

ID of service may be obtained in personal dashboard at services control section- it's "d0000" thing besides service name. Make sure to use only number in your Qrator API calls.

Service Status

service_status_get

Returns current service status.

Added

v1.0.11

Parameters

None

Return Values

Enum with value from following list:

  • offline: domain is offline
  • online: domain is online
  • pending: some operations are performed on the domain
  • error: previous operation failed

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 52

{"method":"service_status_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 52
X-Qrator-Auth: aabbccddeeff

{"method":"service_status_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 39

{"result":"online","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_status_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_status_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"online","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_status_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_status_get","params":null,"id":1}'
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}

Service IP

service_ip_test

Test given IP addresses to be valid IPList.

Added

v1.0.11

Parameters

IPList

Return Values

IPList

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 74

{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 74
X-Qrator-Auth: aabbccddeeff

{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 60

{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        "198.51.100.12"
    ],
    "error": null,
    "id": 1
}

service_ip_get

Returns current upstream IPs.

Added

v1.0.11

Parameters

None

Return Values

IPList

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48

{"method":"service_ip_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48
X-Qrator-Auth: aabbccddeeff

{"method":"service_ip_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66

{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ip_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ip_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ip_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ip_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "error": null,
    "id": 1
}

service_ip_set

Sets service's upstream IPs..

Added

v1.0.11

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 79

{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 79
X-Qrator-Auth: aabbccddeeff

{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ip_set","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Service Ports

service_ports_test

Tests given ServicePorts set to be valid.

Added

v1.0.11

Parameters

ServicePorts

Return Values

ServicePorts

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 110

{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 110
X-Qrator-Auth: aabbccddeeff

{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 93

{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
{
    "result": {
        "22": [
            "tcp"
        ],
        "53": [
            "tcp",
            "udp"
        ],
        "80": [
            "http"
        ],
        "443": [
            "http"
        ]
    },
    "error": null,
    "id": 1
}

service_ports_get

Returns current upstream ports.

Added

v1.0.11

Parameters

None

Return Values

ServicePorts

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 51

{"method":"service_ports_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 51
X-Qrator-Auth: aabbccddeeff

{"method":"service_ports_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 93

{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ports_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ports_get","params":null,"id":1}' --quiet -O -
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ports_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ports_get","params":null,"id":1}'
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
{
    "result": {
        "22": [
            "tcp"
        ],
        "53": [
            "tcp",
            "udp"
        ],
        "80": [
            "http"
        ],
        "443": [
            "http"
        ]
    },
    "error": null,
    "id": 1
}

service_ports_set

Sets service's upstream ports.

Added

v1.0.11

Parameters

ServicePorts

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 109

{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 109
X-Qrator-Auth: aabbccddeeff

{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Whitelist

whitelist_get

Returns service whitelist contents.

Parameters

None

Return Values

IPList or TimedIPList

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47

{"method":"whitelist_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66

{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "error": null,
    "id": 1
}

whitelist_append

Added given IP addresses to service whitelist.

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

whitelist_remove

Removes given IP addresses from service whitelist.

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75

{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

Blacklist

blacklist_get

Returns domains blacklist contents.

Added

v1.0.19

Parameters

None

Return Values

TimedIPList

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47

{"method":"blacklist_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 47
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 66

{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_get","params":null,"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_get","params":null,"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ]
    ],
    "error": null,
    "id": 1
}

blacklist_append

Added given IP addresses to services blacklist.

Added

v1.0.11

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 81
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_remove

Removes given IP addresses from services blacklist.

Added

v1.0.11

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75

{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 75
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_flush

Removes from blacklist all IP addresses, that been added using Qrator API

Added

v1.0.11

Parameters

None

Return Values

RequestSuccess

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49

{"method":"blacklist_flush","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 49
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_flush","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 43

{"result":"Successful","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_flush","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_flush","params":null,"id":1}' --quiet -O -
Copy
{"result":"Successful","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_flush","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_flush","params":null,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}

blacklist_check

Checks if given IP address is blacklisted or not.

Added

v1.0.11

Parameters

IP

Return Values

Enum with value from following list:

  • Banned: given IP address is blacklisted
  • NotBanned: given IP address is not blacklisted

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 62
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_check","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 42

{"result":"NotBanned","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}'
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}

blacklist_status

Checks if given IP address is blacklisted or not, if it is - return reason.

Added

v1.0.11

Parameters

IP

Return Values

Enum with value from following list:

  • NotBanned: IP address is not blacklisted by Qrator, API, client or WAF
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 63
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_status","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 42

{"result":"NotBanned","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}'
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}

Statistics

statistics_get

Returns latest statistics snapshot.

Added

v1.0.11

Parameters

None

Return Values

StatisticsResponse

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48

{"method":"statistics_get","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 48
X-Qrator-Auth: aabbccddeeff

{"method":"statistics_get","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 358

{"result":"{\"time\":1469998800,\"bsend\":0,\"brecv\":0,\"bout\":0,\"psend\":0,\"precv\":0,\"reqspeed\":0,\"reqlonger10s\":0,\"reqlonger07s\":0,\"reqlonger05s\":0,\"reqlonger02s\":0,\"reqall\":0,\"err50x\":0,\"err501\":0,\"err502\":0,\"err503\":0,\"err504\":0,\"ban\":0,\"ban_api\":0,\"ban_waf\":0,\"ban_geo\":[\"RU\":1],\"billable\":0}","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_get","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"statistics_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"{\"time\":1469998800,\"bsend\":0,\"brecv\":0,\"bout\":0,\"psend\":0,\"precv\":0,\"reqspeed\":0,\"reqlonger10s\":0,\"reqlonger07s\":0,\"reqlonger05s\":0,\"reqlonger02s\":0,\"reqall\":0,\"err50x\":0,\"err501\":0,\"err502\":0,\"err503\":0,\"err504\":0,\"ban\":0,\"ban_api\":0,\"ban_waf\":0,\"ban_geo\":[\"RU\":1],\"billable\":0}","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_get","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"statistics_get","params":null,"id":1}'
Copy
{"result":"{\"time\":1469998800,\"bsend\":0,\"brecv\":0,\"bout\":0,\"psend\":0,\"precv\":0,\"reqspeed\":0,\"reqlonger10s\":0,\"reqlonger07s\":0,\"reqlonger05s\":0,\"reqlonger02s\":0,\"reqall\":0,\"err50x\":0,\"err501\":0,\"err502\":0,\"err503\":0,\"err504\":0,\"ban\":0,\"ban_api\":0,\"ban_waf\":0,\"ban_geo\":[\"RU\":1],\"billable\":0}","error":null,"id":1}
Copy
{
    "result": "{\"time\":1469998800,\"bsend\":0,\"brecv\":0,\"bout\":0,\"psend\":0,\"precv\":0,\"reqspeed\":0,\"reqlonger10s\":0,\"reqlonger07s\":0,\"reqlonger05s\":0,\"reqlonger02s\":0,\"reqall\":0,\"err50x\":0,\"err501\":0,\"err502\":0,\"err503\":0,\"err504\":0,\"ban\":0,\"ban_api\":0,\"ban_waf\":0,\"ban_geo\":[\"RU\":1],\"billable\":0}",
    "error": null,
    "id": 1
}

Troubleshoot

ip_status

Checks status of given IP address.

Added

v1.0.11

Parameters

IP

Return Values

Enum with value from following list:

  • Upstream: IP address is one of the upstreams IPs
  • Whitelisted: IP address is whitelisted
  • Banned: IP address is blacklisted by Qrator
  • API: IP address is blacklisted by client using Qrator API
  • HTTP: IP address is blacklisted by client using HTTP code (456)
  • WAF: IP address is blacklisted by WAF
  • Allowed: IP address is is neither upstream nor the whitelisted, nor the blacklisted

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 56

{"method":"ip_status","params":["198.51.100.12"],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 56
X-Qrator-Auth: aabbccddeeff

{"method":"ip_status","params":["198.51.100.12"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 40

{"result":"Allowed","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ip_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ip_status","params":["198.51.100.12"],"id":1}' --quiet -O -
Copy
{"result":"Allowed","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ip_status","params":["198.51.100.12"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ip_status","params":["198.51.100.12"],"id":1}'
Copy
{"result":"Allowed","error":null,"id":1}
Copy
{
    "result": "Allowed",
    "error": null,
    "id": 1
}

ping

Dummy method used to check that your request is OK and API is sane.

Parameters

None

Return Values

String "pong"

Example

Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38

{"method":"ping","params":null,"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 38
X-Qrator-Auth: aabbccddeeff

{"method":"ping","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 37

{"result":"pong","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' --header='X-Qrator-Auth: aabbccddeeff'
  --post-data '{"method":"ping","params":null,"id":1}' --quiet -O -
Copy
{"result":"pong","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H 'X-Qrator-Auth: aabbccddeeff' \
  --data '{"method":"ping","params":null,"id":1}'
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}

Support

If already you are Qrator client - please use ticket system at personal dashboard.

Otherwise feel free to contact our support via mail support@qrator.net

Changelog

1.0.19

Sep 12 2018

1.0.18

Mar 01 2018

  • Minor backend updates

1.0.17

Feb 27 2018

1.0.15

Dec 4 2017

1.0.14

Oct 9 2017

1.0.13

Aug 16 2017

1.0.12

Jun 28 2017

1.0.11

Jun 27 2017

1.0.10

Apr 19 2017

1.0.9

Apr 11 2017

1.0.8

Feb 01 2017

1.0.7

Dec 23 2016

1.0.6

Dec 07 2016

1.0.5

Nov 17 2016

1.0.4

Sep 20 2016

1.0.3

Aug 10 2016

1.0.2

Aug 2 2016