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 POST request to https://api.qrator.net.

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.

Transport

Staring for October 1st 2019 all API-calls should be made via HTTPS.

Any plain-TCP HTTP API-call will result to HTTP 426 response (response details).

Version

Current version of Qrator API is v1.4.3

Qrator API retains backward compatibility with all previous versions.

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

AccessPolicy

Added in v1.1.8

String representation of policy status:

  • accept - traffic from not-whitelisted IP will be accepted;
  • drop - traffic from not-whitelisted IP will be dropped.

Default policy is accept.

Certificate

Added in v1.2.1

Processed and ready to use certificate (with private key).

{
    "id": 320,
    "type": "upload",
    "not_valid_before": 1481545141,
    "not_valid_after": 1607775541,
    "autoupdate": null,
    "domain_id": null,
    "hostnames": [
        "*.example.com",
        "example.com"
    ],
    "protect_key": false,
    "certificates": [
        {
            "type": "rsa",
            "cert": "# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n",
            "key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"
        }
    ],
    "links": [
        {
            "link_id": 1102,
            "port": 443,
            "hostname": "*.example.com",
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1101,
            "port": 443,
            "hostname": "example.com",
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1100,
            "port": 443,
            "hostname": null,
            "domain_id": 1,
            "certificate": 320
        }
    ]
}

type is a Enumwith value from following list:

  • upload: Certificate was uploaded via Personal Dashboard or via API
  • letsencrypt: Certificate was created by Qrator via Let's Encrypt

Let's Encrypt certificates only:

  • autoupdate - shows if Qrator will try to renew and update certificate as soon as possible by Let's Encrypt rules.
  • domain_id - shows which Qrator domain was used to issue certificate.

Upload certificates will have these properties with NULL value.

protect_key show that private key is protected and wouldn't be show at Personal Dashboard or API.

certificates list of certificate-key pairs (PEM formatted) divided by hashing algorithm.

For example - for all Let's Encrypt certificates we use 2 certificate chains (RSA and EC) to maximize security and compatibility.

For certificates with protected keys (protect_key): key property will have special value <<<protected>>>

Added in v1.2.1

Object representing a link of domain_id-port-hostname-certificate (minimal SNI part).

{
    "link_id": 1101,
    "port": 443,
    "hostname": "example.com",
    "domain_id": 1,
    "certificate": 320
}

hostname can have a NULL value in this case it represents a default hostname.

Added in v1.2.1

List of CertificateLink

[
    {
        "link_id": 1100,
        "port": 443,
        "hostname": null,
        "domain_id": 1,
        "certificate": 320
    },
    {
        "link_id": 1101,
        "port": 443,
        "hostname": "example.com",
        "domain_id": 1,
        "certificate": 320
    },
    {
        "link_id": 1102,
        "port": 443,
        "hostname": "*.example.com",
        "domain_id": 1,
        "certificate": 320
    }
]

CertificateList

Added in v1.2.1

List of Certificate

CertificateRequest

Added in v1.2.1

Entity that represents request for adding PEM to Certificate Storage

{
    "id": 333,
    "type": "upload",
    "created": 1600941096,
    "status": "done",
    "domain_id": null,
    "hostnames": null,
    "result": {
        "chains": [
            {
                "chain_key": "A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                "chain_id": 1,
                "not_valid_before": "2019-09-18T15:03:30Z",
                "not_valid_after": "2019-12-17T15:03:30Z",
                "subject": "/CN=example.com",
                "sha1": "BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA",
                "sha256": "AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                "private_key_type": "RSA",
                "private_key_size": 2048,
                "is_trusted_ca": true,
                "is_self_signed": false,
                "is_outdated": true,
                "is_future": false,
                "details": [
                    {
                        "subject": "/CN=example.com",
                        "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                        "not_valid_before": "2019-09-18T15:03:30Z",
                        "not_valid_after": "2019-12-17T15:03:30Z"
                    },
                    {
                        "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                        "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "not_valid_before": "2016-03-17T16:40:46Z",
                        "not_valid_after": "2021-03-17T16:40:46Z"
                    },
                    {
                        "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "not_valid_before": "2000-09-30T21:12:19Z",
                        "not_valid_after": "2021-09-30T14:01:15Z"
                    }
                ]
            },
            {
                "chain_key": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                "chain_id": 1,
                "not_valid_before": "2019-04-08T20:19:21Z",
                "not_valid_after": "2019-07-07T20:19:21Z",
                "subject": "/CN=example.com",
                "sha1": "FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF",
                "sha256": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                "private_key_type": "RSA",
                "private_key_size": 2048,
                "is_trusted_ca": true,
                "is_self_signed": false,
                "is_outdated": true,
                "is_future": false,
                "details": [
                    {
                        "subject": "/CN=example.com",
                        "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                        "not_valid_before": "2019-04-08T20:19:21Z",
                        "not_valid_after": "2019-07-07T20:19:21Z"
                    },
                    {
                        "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                        "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "not_valid_before": "2016-03-17T16:40:46Z",
                        "not_valid_after": "2021-03-17T16:40:46Z"
                    },
                    {
                        "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                        "not_valid_before": "2000-09-30T21:12:19Z",
                        "not_valid_after": "2021-09-30T14:01:15Z"
                    }
                ]
            }
        ],
        "file_errors": [],
        "errors": null,
        "domain_errors": null
    }
}

type is a Enumwith value from following list:

  • upload: Certificate was uploaded via Personal Dashboard or via API
  • letsencrypt: Certificate was created by Qrator via Let's Encrypt

status is a Enumwith value from following list:

  • new: unprocessed request you need to wait a bit
  • done: certificate request is processed with out errors and ready to be add to Certificate Storage
  • error: certificate request is processed with errors, take a look at result.error property

Usually it take <1 minute to process upload certificate request and approx. 15 minues to process letsencrypt certificate request

Let's Encrypt certificate requests only:

  • domain_id - shows which Qrator domain was used to issue certificate
  • hostnames - list of hostnames should be used as CN and SAN fields of certificate

Upload certificate requests will have these properties with NULL value.

result.chains is a list of certificate-chains that found in uploaded PEM's or in issued certificate

CertificateRequestList

Added in v1.2.1

List of CertificateRequest

CertificateSniState

Added in v1.4.1

An array of certificate links (objects) representing SNI-state:

[
    {
        "port": 443,
        "hostname": null,                   // null stands for default hostname
        "certificate": 420                  // ID of certificate
    },
    {
        "port": 443,
        "hostname": "example.com",
        "certificate": 420
    },
    {
        "port": 443,
        "hostname": "www.example.com",
        "certificate": 421
    }
]

To be valid state should follow rules:

  • has link for default hostname (null), with one exception - empty state;
  • there must NOT be any links with the same hostname (no duplicates);
  • maximum number of links in state is 1000 links;
  • (currently) only port: 443 is supported.

Contact

Added in v1.3.13

Single contact registered at Qrator personal dashboard

{
    "id": 1,
    "email": "john@example.com",
    "first_name": "John",
    "middle_name": "Random",
    "last_name": "User",
    "master_contact": true,
    "role": {
        "technical": false,
        "finance": true,
        "administrative": true
    },
    "2fa_enabled": true,
    "lang": "en",
    "report_lang": "en",
    "policy_groups": [
        1,
        2,
        3
    ]
}

ContactCreateObject

Added in v1.3.13

Structure to describe new contact data, used by contact_create

{
    "email": "john@example.com",
    "first_name": "John",
    "middle_name": "Smith",
    "last_name": "Random",
    "lang": "en",
    "report_lang": "en",
    "password": "my5ecu4ePassw0rd",
    "roles": [
        "technical",
        "finance",
        "administrative"
    ],
    "send_password_reset": true,
    "policy_groups": [
        1,
        2,
        3
    ]
}
  • email is required and should be a valid email.
  • first_name is required.
  • middle_name is optional.
  • last_name is required.
  • lang is required, enum("en", "ru"), default - "en".
  • report_lang is required, enum("en", "ru", "disable"), default - "disable".
  • password is optional.
  • roles is required, array or enum("technical", "finance", "administrative")
  • send_password_reset is optional, boolean, default - true, should we send notification to user?
  • policy_groups array of policy group ids user belongs to

Field roles can be used in one of two forms:

Array of enums

"roles": [
    "finance",
    "administrative"
]

Dict with "enabled" flags, like in Contact

"roles": [
    "technical": false,
    "finance": true,
    "administrative": true
]

This couple of examples shows same set of roles (finance+administrative).

ContactList

Added in v1.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",
        "master_contact": true,
        "role": {
            "technical": false,
            "finance": true,
            "administrative": true
        },
        "2fa_enabled": true,
        "lang": "en",
        "report_lang": "en",
        "policy_groups": [
            1,
            2,
            3
        ]
    }
]

DomainList

Added in v1.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": {
                "53": "dns",
                "79": [
                    "tcp",
                    "udp"
                ],
                "80": "http",
                "443": "http"
            }
        }
    ],
    "error": null,
    "id": 1
}

Field ports will always be null for domains and ServicePorts for services.

Field ip_json will always be object for domains and list for services.

Enum

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

IP

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

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

Please note all IPs used in examples are from loopback interface, private local networks or documentation IP-ranges.
While using examples please make sure you use valid IPs.

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
}

Month

Added in v1.1.2

Representation for year+month, could have one of given forms:

// minus-separated string
"2019-07" or "06-2019"

// array
[2019, 6]

// object
{"year": 2019, "month": 4}

NULL

Regular null value

NetworkList

Added in v1.0.10

List of IP/mask networks

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

Number

Just a number huh ;)

PolicyGroupList

Added in v1.4.3

List of policy groups

[
    {
        "id": 1,
        "name": "Policy group name"
    }
]

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 v1.0.11

Set of numeric ports and ServiceProto

{
    "method": "<method name>",
    "params": {
        "53": "dns",
        "79": [
            "tcp",
            "udp"
        ],
        "80": "http",
        "443": "http"
    },
    "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 v1.0.11

String representation of service protocol, current supported protocols:

  • http
  • tcp
  • udp
  • udp
  • dns

StatisticsCurrentBlocks

Added in v1.2.2

Object for blocks made by Qrator, Qrator.Antibot or WAF

{
    "result": {
        "time": 1606828607,    // timestamp for snapshot
        "Qrator401": 28.2,     // request rate (rps), intercepted by Antibot with js-challenge
        "Qrator403": 0.3,      // request rate (rps), blocked by Qrator (inc. Antibot)
        "Waf403": 0.13,        // request rate (rps), blocked by WAF
        "Qrator503Con": 32.44, // request rate (rps), blocked by Qrator
        "Qrator503Req": 40.28  // request rate (rps), blocked by Qrator
    },
    "error": null,
    "id: 1
}

values are nullable float, null is used in cases when client doesn't have Antibot/WAF services

StatisticsCurrentDNS

Added in v1.3.1

Object, representing latest statistics snapshot for DNS-metrics

{
    "result": {
        "time": 1563204000, // timestamp for snapshot
        "cache": {
            "hit": 0,
        },
        "requests": {
            "upstream": 0,
            "invalid": 0,
            "types": {
                "A": 0,     // requests rate (rps), type A
                "AAAA": 0,  // requests rate (rps), type AAAA
                "ANY": 0,   // requests rate (rps), type ANY
                "CNAME": 0, // requests rate (rps), type CNAME
                "NS": 0,    // requests rate (rps), type NS
                "SOA": 0,   // requests rate (rps), type SOA
                "TXT": 0    // requests rate (rps), type TXT
            },
            "protocol": {
                "tcp": 0,   // requests rate (rps), protocol TCP
                "udp": 0    // requests rate (rps), protocol UDP
            }
        },
        "errors_user": {
            "NXDOMAIN": 0,  // errors rate (rps), Connect
            "SERVFAIL": 0,  // errors rate (rps), Connect
        },
        "errors_upstream": {
            "Connect": 0,   // errors rate (rps), Connect
            "Recv": 0,      // errors rate (rps), Connect
            "Send": 0,      // errors rate (rps), Connect
            "Timeout": 0    // errors rate (rps), Timeout
        }
    },
    "error": null,
    "id: 1
}

StatisticsCurrentHTTP

Added in v1.1.2

Object, representing latest statistics snapshot for HTTP-metrics

{
    "result": {
        "time": 1563204000, // timestamp for snapshot
        "requests": 0,      // request rate (rps)
        "responses": {
            "0000_0200": 0, // responses rate (rps), duration 0.0-0.2s
            "0200_0500": 0, // responses rate (rps), duration 0.2-0.5s
            "0500_0700": 0, // responses rate (rps), duration 0.5-0.7s
            "0700_1000": 0, // responses rate (rps), duration 0.7-1.0s
            "1000_1500": 0, // responses rate (rps), duration 1.0-1.5s
            "1500_2000": 0, // responses rate (rps), duration 1.5-2.0s
            "2000_5000": 0, // responses rate (rps), duration 2.0-5.0s
            "5000_inf": 0   // responses rate (rps), duration over 5s
        },
        "errors": {
            "total": 0,     // errors rate (rps), total (5xx)
            "500": 0,       // errors rate (rps), HTTP-500
            "501": 0,       // errors rate (rps), HTTP-501
            "502": 0,       // errors rate (rps), HTTP-502
            "503": 0,       // errors rate (rps), HTTP-503
            "504": 0,       // errors rate (rps), HTTP-504
            "4xx": 0        // errors rate (rps), HTTP-400..499
        }
    },
    "error": null,
    "id: 1
}

StatisticsCurrentIP

Added in v1.1.2

Object, representing latest statistics snapshot for IP-metrics

{
    "result": {
        "time": 1563204000, // timestamp for snapshot
        "bandwidth": {
            "input": 0,     // incoming traffic (bps)
            "passed": 0,    // passed traffic (bps)
            "output": 0     // outgoing traffic (bps)
        },
        "packets": {
            "input": 0,     // incoming packets (pps)
            "passed": 0,    // passed packets (pps)
            "output": 0     // outgoing packets (pps)
        },
        "blacklist": {
            "qrator": 0,    // number of IPs banned by Qrator
            "api": 0,       // number of IPs banned by client via Qrator.API
            "waf": 0        // number of IPs banned by WAF
        }
    },
    "error": null,
    "id: 1
}

StatisticsCurrentLocations

Added in v1.2.2

Object for Geo-locations of IPs in blacklist

{
    "result": {
        "time": 1606828607, // timestamp for snapshot
        "locations": {      // ISO 3166-1 alpha-2
            "A1": 341.5,
            "RU": 65.3,
            "ID": 49,
            "US": 27,
            "BR": 26
        }
    },
    "error": null,
    "id: 1
}

values are float and they represent "average count for last minute"

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
}

StringList

Added in v1.2.8

List of Strings

TimedIP

Added in v1.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

Since v1.3.0 TimedIP in some cases could contain comment (see TimedIpMode) and has form:

[
    "192.0.2.1",
    300,
    "some comment"
]

Each method that uses this form (ex. blacklist_get/blacklist_append) will have appropriate notice.

TimedIPList

Added in v1.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
}

TimedIpMode

Added in v1.3.0

Feature flag to switch mode for TimedIpList handling:

  • legacy - only basic forms:
    • only IP: "192.0.2.1"
    • IP and timeout: ["192.0.2.1", 300]
  • tuple - same as legacy with extra form (as of v1.3.0):
    • IP, timeout and comment: ["192.0.2.1", 300, "comment"]

In most cases default value is legacy.

UpstreamConfiguration

Added in v1.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

Common reasons

Following error are common for all methods.

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-Request-Id: d12...6ce // id for your request (string, hash)
X-Qrator-API-IP: 192.0.2.1     // calling (your) IP address (string)
X-Qrator-API-HTTPS: yes        // call via HTTPS  (string: yes | no)
X-Qrator-API-SRV: ok           // request 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)
X-Qrator-API-Auth: token       // auth type used (string: token | ip)

<response body>

Also API response could have X-Qrator-API-Error-Details header, it may add some details about error.

Transport errors

HTTP 426 Upgrade Required

This error occurs for any API call requested via plain HTTP.

You should use HTTPS connection to resolve this error, see Transport for details.

Example of response (for HTTP request):

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

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

HTTP/1.1 426 Upgrade Required
Server: QRATOR
Content-Type: application/json
Content-Length: 133
Connection: close
X-Qrator-API-Version: 1.1.4
X-Qrator-API-Mode: debug
X-Qrator-API-IP: 192.0.2.1
X-Qrator-API-HTTPS: no
X-Qrator-API-SRV: fail
Upgrade: TLS/1.3, HTTP/1.1
X-Qrator-API-Error-Details: HTTP transport exception

Usage of plain TCP for API calls is forbidden.
You should use HTTPS as transport.
See https://api.qrator.net/#transport for details.

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
import requests

url="https://api.qrator.net/request/debug/"
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/debug/"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"pong","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}
Copy
null

Test

service_ports_test

Tests given ServicePorts set to be valid, invalid port definitions will be removed.

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: 141

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

{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"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"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"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"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"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"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"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"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"id":1}'
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/debug/"
payload={"method":"service_ports_test","params":{"80":["http"],"443":["http"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/debug/"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ports_test","params":{"80":["http"],"443":["http"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"444":["ntp"],"53":["tcp","udp"],"22":["tcp"],"65536":["http"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
{
    "80": [
        "http"
    ],
    "443": [
        "http"
    ],
    "444": [
        "ntp"
    ],
    "53": [
        "tcp",
        "udp"
    ],
    "22": [
        "tcp"
    ],
    "65536": [
        "http"
    ]
}

test_iplist

Test given IP addresses to be valid IPList.

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
import requests

url="https://api.qrator.net/request/debug/"
payload={"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/debug/"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_iplist","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

test_timediplist

Test given IP addresses to be valid TimedIPList.

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
import requests

url="https://api.qrator.net/request/debug/"
payload={"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/debug/"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[["192.0.2.1",80],["198.51.100.12",0]],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_timediplist","params":[["192.0.2.1",80],"198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
[
    [
        "192.0.2.1",
        80
    ],
    "198.51.100.12"
]

test_upstreamlist

Test given IP addresses to be valid IPList 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
import requests

url="https://api.qrator.net/request/debug/"
payload={"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/debug/"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/debug/",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"test_upstreamlist","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

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 bottom of the page. Make sure to use only number in your Qrator API calls.

Domains

domain_create

Creates single domain

Added

v1.0.23

Parameters

Array of "Upstreams + Name" - [IPList or UpstreamConfiguration, String]

Return Values

Number - id of created domain

Example

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

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

{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":12,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"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":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}' --quiet -O -
Copy
{"result":12,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}'
Copy
{"result":12,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":12,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_create","params":[["127.0.0.1","127.255.255.254"],"domain.example.com"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":12,"error":null,"id":1}
Copy
{
    "result": 12,
    "error": null,
    "id": 1
}
Copy
[
    [
        "127.0.0.1",
        "127.255.255.254"
    ],
    "domain.example.com"
]

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: 649

{"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":["198.51.100.12"],"ip_json":["198.51.100.12"],"qratorIp":"service","isService":true,"ports":{"53":"dns","79":["tcp","udp"],"80":"http","443":"http"}}],"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":["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":["198.51.100.12"],"ip_json":["198.51.100.12"],"qratorIp":"service","isService":true,"ports":{"53":"dns","79":["tcp","udp"],"80":"http","443":"http"}}],"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":["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":["198.51.100.12"],"ip_json":["198.51.100.12"],"qratorIp":"service","isService":true,"ports":{"53":"dns","79":["tcp","udp"],"80":"http","443":"http"}}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"domains_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domains_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"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":None},{"id":2,"name":"text.example.com","status":"online","ip":["198.51.100.12"],"ip_json":["198.51.100.12"],"qratorIp":"service","isService":true,"ports":{"53":"dns","79":["tcp","udp"],"80":"http","443":"http"}}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domains_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domains_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"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":["198.51.100.12"],"ip_json":["198.51.100.12"],"qratorIp":"service","isService":true,"ports":{"53":"dns","79":["tcp","udp"],"80":"http","443":"http"}}],"error":null,"id":1}
Copy
{
    "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": [
                "198.51.100.12"
            ],
            "ip_json": [
                "198.51.100.12"
            ],
            "qratorIp": "service",
            "isService": true,
            "ports": {
                "53": "dns",
                "79": [
                    "tcp",
                    "udp"
                ],
                "80": "http",
                "443": "http"
            }
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

Prefixes

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: 69

{"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: 69
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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"prefix_announce_off","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"prefix_announce_off","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_off","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_off","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "178.248.232.0/23"
]

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: 68

{"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: 68
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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"prefix_announce_on","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"prefix_announce_on","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_on","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_on","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "178.248.232.0/23"
]

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: 72

{"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: 72
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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"prefix_announce_status","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"prefix_announce_status","params":["178.248.232.0/23"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"offline","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_status","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_announce_status","params":["178.248.232.0/23"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"offline","error":null,"id":1}
Copy
{
    "result": "offline",
    "error": null,
    "id": 1
}
Copy
[
    "178.248.232.0/23"
]

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: 134

{"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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"prefix_list","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"prefix_list","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"announce":"offline","prefix":"178.248.232.0/23"},{"announce":"offline","prefix":"178.248.232.0/24"}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"prefix_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

Services

service_create

Creates single service

Added

v1.0.23

Parameters

Array of "Upstreams + Ports + Name" - [ IPList, ServicePorts, String]

Return Values

Number - id of created service

Example

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

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

{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":13,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"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":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}' --quiet -O -
Copy
{"result":13,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}'
Copy
{"result":13,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":13,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_create","params":[["127.0.0.1","127.255.255.254"],{"22":"tcp","53":["tcp","udp"],"80":"http","443":"http"},"service.example.com"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":13,"error":null,"id":1}
Copy
{
    "result": 13,
    "error": null,
    "id": 1
}
Copy
[
    [
        "127.0.0.1",
        "127.255.255.254"
    ],
    {
        "22": "tcp",
        "53": [
            "tcp",
            "udp"
        ],
        "80": "http",
        "443": "http"
    },
    "service.example.com"
]

Whitelist

whitelist_append

Added given IP addresses to whitelist.

This method supports TimedIP with comments.

Added

v1.3.12

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

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

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 176
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"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":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"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":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"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":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/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],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"with comment and timeout"],["198.51.100.22",0,"with comment, permanent"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "with comment and timeout"
    ],
    [
        "198.51.100.22",
        0,
        "with comment, permanent"
    ]
]

whitelist_relay_append

Added given IP addresses to whitelist.

This method supports TimedIP without comments.

Added

v1.4.0

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

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

{"method":"whitelist_relay_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/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"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":"whitelist_relay_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/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

whitelist_remove

Removes given IP addresses from whitelist.

Added

v1.3.12

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/client/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/client/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/client/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/client/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/client/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/client/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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

Blacklist

blacklist_append

Added given IP addresses to blacklist.

This method supports TimedIP with comments.

Added

v1.3.5

Parameters

IPList or TimedIPList

Return Values

RequestSuccess

Example

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

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

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/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],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "some comment"
    ]
]

blacklist_check

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

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"1":"Banned","2":"NotBanned"},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"1":"Banned","2":"NotBanned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "Banned",
        "2": "NotBanned"
    },
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

blacklist_relay_ban

Added given IP addresses to blacklist.

This method supports TimedIP without comments.

Added

v1.3.5

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

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

{"method":"blacklist_relay_ban","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/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"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_relay_ban","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/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

blacklist_remove

Removes given IP addresses from blacklist.

Added

v1.3.5

Parameters

IPList

Return Values

RequestSuccess

Example

Copy
POST /request/client/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/client/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/client/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/client/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/client/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/client/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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

blacklist_status

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

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"1":"HTTP","2":"NotBanned"},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"1":"HTTP","2":"NotBanned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "HTTP",
        "2": "NotBanned"
    },
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

Contacts

contact_create

Added

v1.3.13

Parameters

ContactCreateObject

Return Values

Contact

Example

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

{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 286
X-Qrator-Auth: aabbccddeeff

{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 219

{"result":{"id":1001,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true,"policy_groups":[1,2,3]}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"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":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}' --quiet -O -
Copy
{"result":{"id":1001,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true,"policy_groups":[1,2,3]}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}'
Copy
{"result":{"id":1001,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true,"policy_groups":[1,2,3]}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"id":1001,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true,"policy_groups":[1,2,3]}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"contact_create","params":{"email":"john@example.com","first_name":"John","middle_name":"Smith","last_name":"Random","lang":"en","report_lang":"en","password":"my5ecu4ePassw0rd","roles":["technical","administrative"],"send_password_reset":true,"policy_groups":[1,2,3]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"id":1001,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true,"policy_groups":[1,2,3]}},"error":null,"id":1}
Copy
{
    "result": {
        "id": 1001,
        "email": "john@example.com",
        "first_name": "John",
        "middle_name": "Random",
        "last_name": "User",
        "role": {
            "technical": false,
            "finance": true,
            "administrative": true,
            "policy_groups": [
                1,
                2,
                3
            ]
        }
    },
    "error": null,
    "id": 1
}
Copy
{
    "email": "john@example.com",
    "first_name": "John",
    "middle_name": "Smith",
    "last_name": "Random",
    "lang": "en",
    "report_lang": "en",
    "password": "my5ecu4ePassw0rd",
    "roles": [
        "technical",
        "administrative"
    ],
    "send_password_reset": true,
    "policy_groups": [
        1,
        2,
        3
    ]
}

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: 268

{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true},"2fa_enabled":true,"lang":"en","report_lang":"en","policy_groups":[1,2,3]}],"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":{"technical":false,"finance":true,"administrative":true},"2fa_enabled":true,"lang":"en","report_lang":"en","policy_groups":[1,2,3]}],"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":{"technical":false,"finance":true,"administrative":true},"2fa_enabled":true,"lang":"en","report_lang":"en","policy_groups":[1,2,3]}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"contacts_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"contacts_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true},"2fa_enabled":true,"lang":"en","report_lang":"en","policy_groups":[1,2,3]}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"contacts_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"contacts_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"id":1,"email":"john@example.com","first_name":"John","middle_name":"Random","last_name":"User","role":{"technical":false,"finance":true,"administrative":true},"2fa_enabled":true,"lang":"en","report_lang":"en","policy_groups":[1,2,3]}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 1,
            "email": "john@example.com",
            "first_name": "John",
            "middle_name": "Random",
            "last_name": "User",
            "role": {
                "technical": false,
                "finance": true,
                "administrative": true
            },
            "2fa_enabled": true,
            "lang": "en",
            "report_lang": "en",
            "policy_groups": [
                1,
                2,
                3
            ]
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

Returns link (and it's expire time) for loging-in to Personal Dashboard at https://client.qrator.net

Added

v1.3.14

Parameters

Number contact id, boolean flag to skip 2fa (or not) at login (default: false)

Return Values

Contact

Example

policy_groups_get

Returns list of Policy groups

Added

v1.4.3

Parameters

None

Return Values

PolicyGroupList

Example

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

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

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

{"result":[{"id":1,"name":"Policy group name"}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"policy_groups_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":"policy_groups_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"id":1,"name":"Policy group name"}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"policy_groups_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":"policy_groups_get","params":null,"id":1}'
Copy
{"result":[{"id":1,"name":"Policy group name"}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"policy_groups_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"policy_groups_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"id":1,"name":"Policy group name"}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"policy_groups_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"policy_groups_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"id":1,"name":"Policy group name"}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 1,
            "name": "Policy group name"
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

Certificate storage

certificate_get

Get single certificate.

Added

v1.2.8

Parameters

Number certificate id

Return Values

Certificate

Example

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

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

{"method":"certificate_get","params":[302],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1252

{"result":{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certificate_get","params":[302],"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":"certificate_get","params":[302],"id":1}' --quiet -O -
Copy
{"result":{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certificate_get","params":[302],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certificate_get","params":[302],"id":1}'
Copy
{"result":{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certificate_get","params":[302],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certificate_get","params":[302],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":None,"domain_id":None,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":None,"domain_id":1,"certificate":320}]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_get","params":[302],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_get","params":[302],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]},"error":null,"id":1}
Copy
{
    "result": {
        "id": 320,
        "type": "upload",
        "not_valid_before": 1481545141,
        "not_valid_after": 1607775541,
        "autoupdate": null,
        "domain_id": null,
        "hostnames": [
            "*.example.com",
            "example.com"
        ],
        "protect_key": false,
        "certificates": [
            {
                "type": "rsa",
                "cert": "# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n",
                "key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"
            }
        ],
        "links": [
            {
                "link_id": 1102,
                "port": 443,
                "hostname": "*.example.com",
                "domain_id": 1,
                "certificate": 320
            },
            {
                "link_id": 1101,
                "port": 443,
                "hostname": "example.com",
                "domain_id": 1,
                "certificate": 320
            },
            {
                "link_id": 1100,
                "port": 443,
                "hostname": null,
                "domain_id": 1,
                "certificate": 320
            }
        ]
    },
    "error": null,
    "id": 1
}
Copy
[
    302
]

certificate_list

Returns list of your certificates.

Added

v1.2.1

Parameters

None

Return Values

CertificateList

Example

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

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

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

{"result":[{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certificate_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":"certificate_list","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certificate_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":"certificate_list","params":null,"id":1}'
Copy
{"result":[{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certificate_list","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certificate_list","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":None,"domain_id":None,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":None,"domain_id":1,"certificate":320}]}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"id":320,"type":"upload","not_valid_before":1481545141,"not_valid_after":1607775541,"autoupdate":null,"domain_id":null,"hostnames":["*.example.com","example.com"],"protect_key":false,"certificates":[{"type":"rsa","cert":"# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n","key":"-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"}],"links":[{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320}]}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 320,
            "type": "upload",
            "not_valid_before": 1481545141,
            "not_valid_after": 1607775541,
            "autoupdate": null,
            "domain_id": null,
            "hostnames": [
                "*.example.com",
                "example.com"
            ],
            "protect_key": false,
            "certificates": [
                {
                    "type": "rsa",
                    "cert": "# Subject: /OU=Domain Control Validated/CN=*.example.com\n# Domains: *.example.com, example.com\n# Algo: RSA, key size: 2048\n# Issuer: /C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2\n# Not valid before: 2016-12-12T12:19:01Z\n# Not valid after: 2020-12-12T12:19:01Z\n# SHA-1 Fingerprint: C2:30:F7:C1:69:79:1E:1C:56:26:31:E8:ED:D8:AB:E1:FE:06:EC:F7\n# SHA-256 Fingerprint: A7:C7:17:68:96:F1:AB:81:B4:FF:C3:5C:48:20:D2:80:D6:D5:01:21:29:89:9A:60:E2:3F:4A:D1:E2:72:05:FB\n-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----\n",
                    "key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"
                }
            ],
            "links": [
                {
                    "link_id": 1102,
                    "port": 443,
                    "hostname": "*.example.com",
                    "domain_id": 1,
                    "certificate": 320
                },
                {
                    "link_id": 1101,
                    "port": 443,
                    "hostname": "example.com",
                    "domain_id": 1,
                    "certificate": 320
                },
                {
                    "link_id": 1100,
                    "port": 443,
                    "hostname": null,
                    "domain_id": 1,
                    "certificate": 320
                }
            ]
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

certificate_remove

Remove uploaded certificate from storage

Only not in use certificates allowed to be removed with this method.

Added

v1.3.3

Parameters

Number certificate id

Return Values

RequestSuccess

Example

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

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

{"method":"certificate_remove","params":[302],"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":"certificate_remove","params":[302],"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":"certificate_remove","params":[302],"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":"certificate_remove","params":[302],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certificate_remove","params":[302],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certificate_remove","params":[302],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certificate_remove","params":[302],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_remove","params":[302],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certificate_remove","params":[302],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    302
]

certrequest_get

Get single certificate request.

Added

v1.2.8

Parameters

Number request id

Return Values

CertificateRequest

Example

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

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

{"method":"certrequest_get","params":[333],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2492

{"result":{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certrequest_get","params":[333],"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":"certrequest_get","params":[333],"id":1}' --quiet -O -
Copy
{"result":{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certrequest_get","params":[333],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certrequest_get","params":[333],"id":1}'
Copy
{"result":{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_get","params":[333],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_get","params":[333],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":None,"hostnames":None,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":None,"domain_errors":None}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_get","params":[333],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_get","params":[333],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
{
    "result": {
        "id": 333,
        "type": "upload",
        "created": 1600941096,
        "status": "done",
        "domain_id": null,
        "hostnames": null,
        "result": {
            "chains": [
                {
                    "chain_key": "A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                    "chain_id": 1,
                    "not_valid_before": "2019-09-18T15:03:30Z",
                    "not_valid_after": "2019-12-17T15:03:30Z",
                    "subject": "/CN=example.com",
                    "sha1": "BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA",
                    "sha256": "AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                    "private_key_type": "RSA",
                    "private_key_size": 2048,
                    "is_trusted_ca": true,
                    "is_self_signed": false,
                    "is_outdated": true,
                    "is_future": false,
                    "details": [
                        {
                            "subject": "/CN=example.com",
                            "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                            "not_valid_before": "2019-09-18T15:03:30Z",
                            "not_valid_after": "2019-12-17T15:03:30Z"
                        },
                        {
                            "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                            "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "not_valid_before": "2016-03-17T16:40:46Z",
                            "not_valid_after": "2021-03-17T16:40:46Z"
                        },
                        {
                            "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "not_valid_before": "2000-09-30T21:12:19Z",
                            "not_valid_after": "2021-09-30T14:01:15Z"
                        }
                    ]
                },
                {
                    "chain_key": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                    "chain_id": 1,
                    "not_valid_before": "2019-04-08T20:19:21Z",
                    "not_valid_after": "2019-07-07T20:19:21Z",
                    "subject": "/CN=example.com",
                    "sha1": "FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF",
                    "sha256": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                    "private_key_type": "RSA",
                    "private_key_size": 2048,
                    "is_trusted_ca": true,
                    "is_self_signed": false,
                    "is_outdated": true,
                    "is_future": false,
                    "details": [
                        {
                            "subject": "/CN=example.com",
                            "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                            "not_valid_before": "2019-04-08T20:19:21Z",
                            "not_valid_after": "2019-07-07T20:19:21Z"
                        },
                        {
                            "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                            "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "not_valid_before": "2016-03-17T16:40:46Z",
                            "not_valid_after": "2021-03-17T16:40:46Z"
                        },
                        {
                            "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                            "not_valid_before": "2000-09-30T21:12:19Z",
                            "not_valid_after": "2021-09-30T14:01:15Z"
                        }
                    ]
                }
            ],
            "file_errors": [],
            "errors": null,
            "domain_errors": null
        }
    },
    "error": null,
    "id": 1
}
Copy
[
    333
]

certrequest_install

Install one certificate-chain from processed certificate request to your Certificate storage.

Added

v1.2.1

Parameters

Number certificate request id, String Chain key, Number Chain Id

Return Values

Number certificate Id

Example

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

{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 154
X-Qrator-Auth: aabbccddeeff

{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 35

{"result":1104,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"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":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}' --quiet -O -
Copy
{"result":1104,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}'
Copy
{"result":1104,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":1104,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_install","params":[334,"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",1],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":1104,"error":null,"id":1}
Copy
{
    "result": 1104,
    "error": null,
    "id": 1
}
Copy
[
    334,
    "A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
    1
]

certrequest_le

Create new certificate request by issuing Let’s Encrypt certificate.

Only active (online) domains allowed to be used with this method.
List of hostnames is a list and FQDNs (fully qualified domain name, wikipedia), that will be used as subject and SANs (Subject Alternative Name) of certificate.
Rules for list of hostnames:
  • minimum number of hostnames is 1
  • maximum number of hostnames 12.
Rules for each hostname:
  • must have DNS A-record, pointing to qratorIp (see DomainList) of given domain
  • must NOT have DNS AAAA-record
You have to accept LE T&C before using this method, BadRequest will be returned otherwise

Added

v1.2.9

Parameters

Domain id (Number) + non empty list of hostnames (StringList)

Return Values

CertificateRequest

Example

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

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

{"method":"certrequest_le","params":[132,["example.com"]],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 221

{"result":{"id":335,"type":"letsencrypt","created":1659970508,"status":"new","domain_id":132,"hostnames":["example.com"],"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certrequest_le","params":[132,["example.com"]],"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":"certrequest_le","params":[132,["example.com"]],"id":1}' --quiet -O -
Copy
{"result":{"id":335,"type":"letsencrypt","created":1659970508,"status":"new","domain_id":132,"hostnames":["example.com"],"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certrequest_le","params":[132,["example.com"]],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certrequest_le","params":[132,["example.com"]],"id":1}'
Copy
{"result":{"id":335,"type":"letsencrypt","created":1659970508,"status":"new","domain_id":132,"hostnames":["example.com"],"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_le","params":[132,["example.com"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_le","params":[132,["example.com"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"id":335,"type":"letsencrypt","created":1659970508,"status":"new","domain_id":132,"hostnames":["example.com"],"result":{"chains":None,"file_errors":None,"errors":None,"domain_errors":None}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_le","params":[132,["example.com"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_le","params":[132,["example.com"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"id":335,"type":"letsencrypt","created":1659970508,"status":"new","domain_id":132,"hostnames":["example.com"],"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
{
    "result": {
        "id": 335,
        "type": "letsencrypt",
        "created": 1659970508,
        "status": "new",
        "domain_id": 132,
        "hostnames": [
            "example.com"
        ],
        "result": {
            "chains": null,
            "file_errors": null,
            "errors": null,
            "domain_errors": null
        }
    },
    "error": null,
    "id": 1
}
Copy
[
    132,
    [
        "example.com"
    ]
]

certrequest_list

Returns list of your certificate requests.

Added

v1.2.1

Parameters

None

Return Values

CertificateRequestList

Example

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

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

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

{"result":[{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},{"id":334,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certrequest_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":"certrequest_list","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},{"id":334,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certrequest_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":"certrequest_list","params":null,"id":1}'
Copy
{"result":[{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},{"id":334,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_list","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_list","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":None,"hostnames":None,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":None,"domain_errors":None}},{"id":334,"type":"upload","created":1600941096,"status":"done","domain_id":None,"hostnames":None,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":None,"domain_errors":None}}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"id":333,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}},{"id":334,"type":"upload","created":1600941096,"status":"done","domain_id":null,"hostnames":null,"result":{"chains":[{"chain_key":"A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","chain_id":1,"not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z","subject":"/CN=example.com","sha1":"BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA","sha256":"AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-09-18T15:03:30Z","not_valid_after":"2019-12-17T15:03:30Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]},{"chain_key":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","chain_id":1,"not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z","subject":"/CN=example.com","sha1":"FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF","sha256":"DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB","private_key_type":"RSA","private_key_size":2048,"is_trusted_ca":true,"is_self_signed":false,"is_outdated":true,"is_future":false,"details":[{"subject":"/CN=example.com","issuer":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","not_valid_before":"2019-04-08T20:19:21Z","not_valid_after":"2019-07-07T20:19:21Z"},{"subject":"/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2016-03-17T16:40:46Z","not_valid_after":"2021-03-17T16:40:46Z"},{"subject":"/O=Digital Signature Trust Co./CN=DST Root CA X3","issuer":"/O=Digital Signature Trust Co./CN=DST Root CA X3","not_valid_before":"2000-09-30T21:12:19Z","not_valid_after":"2021-09-30T14:01:15Z"}]}],"file_errors":[],"errors":null,"domain_errors":null}}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "id": 333,
            "type": "upload",
            "created": 1600941096,
            "status": "done",
            "domain_id": null,
            "hostnames": null,
            "result": {
                "chains": [
                    {
                        "chain_key": "A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                        "chain_id": 1,
                        "not_valid_before": "2019-09-18T15:03:30Z",
                        "not_valid_after": "2019-12-17T15:03:30Z",
                        "subject": "/CN=example.com",
                        "sha1": "BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA",
                        "sha256": "AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                        "private_key_type": "RSA",
                        "private_key_size": 2048,
                        "is_trusted_ca": true,
                        "is_self_signed": false,
                        "is_outdated": true,
                        "is_future": false,
                        "details": [
                            {
                                "subject": "/CN=example.com",
                                "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "not_valid_before": "2019-09-18T15:03:30Z",
                                "not_valid_after": "2019-12-17T15:03:30Z"
                            },
                            {
                                "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2016-03-17T16:40:46Z",
                                "not_valid_after": "2021-03-17T16:40:46Z"
                            },
                            {
                                "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2000-09-30T21:12:19Z",
                                "not_valid_after": "2021-09-30T14:01:15Z"
                            }
                        ]
                    },
                    {
                        "chain_key": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                        "chain_id": 1,
                        "not_valid_before": "2019-04-08T20:19:21Z",
                        "not_valid_after": "2019-07-07T20:19:21Z",
                        "subject": "/CN=example.com",
                        "sha1": "FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF",
                        "sha256": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                        "private_key_type": "RSA",
                        "private_key_size": 2048,
                        "is_trusted_ca": true,
                        "is_self_signed": false,
                        "is_outdated": true,
                        "is_future": false,
                        "details": [
                            {
                                "subject": "/CN=example.com",
                                "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "not_valid_before": "2019-04-08T20:19:21Z",
                                "not_valid_after": "2019-07-07T20:19:21Z"
                            },
                            {
                                "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2016-03-17T16:40:46Z",
                                "not_valid_after": "2021-03-17T16:40:46Z"
                            },
                            {
                                "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2000-09-30T21:12:19Z",
                                "not_valid_after": "2021-09-30T14:01:15Z"
                            }
                        ]
                    }
                ],
                "file_errors": [],
                "errors": null,
                "domain_errors": null
            }
        },
        {
            "id": 334,
            "type": "upload",
            "created": 1600941096,
            "status": "done",
            "domain_id": null,
            "hostnames": null,
            "result": {
                "chains": [
                    {
                        "chain_key": "A5:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                        "chain_id": 1,
                        "not_valid_before": "2019-09-18T15:03:30Z",
                        "not_valid_after": "2019-12-17T15:03:30Z",
                        "subject": "/CN=example.com",
                        "sha1": "BF:0D:E9:2B:C0:CA:2E:87:E3:82:9A:12:0C:8C:F1:AF:46:E9:0E:CA",
                        "sha256": "AF:49:6D:09:A5:70:42:85:D3:76:CD:9E:71:4C:B0:24:07:B3:F2:0C:59:04:4B:69:FB:12:93:83:EE:9C:60:D7",
                        "private_key_type": "RSA",
                        "private_key_size": 2048,
                        "is_trusted_ca": true,
                        "is_self_signed": false,
                        "is_outdated": true,
                        "is_future": false,
                        "details": [
                            {
                                "subject": "/CN=example.com",
                                "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "not_valid_before": "2019-09-18T15:03:30Z",
                                "not_valid_after": "2019-12-17T15:03:30Z"
                            },
                            {
                                "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2016-03-17T16:40:46Z",
                                "not_valid_after": "2021-03-17T16:40:46Z"
                            },
                            {
                                "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2000-09-30T21:12:19Z",
                                "not_valid_after": "2021-09-30T14:01:15Z"
                            }
                        ]
                    },
                    {
                        "chain_key": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                        "chain_id": 1,
                        "not_valid_before": "2019-04-08T20:19:21Z",
                        "not_valid_after": "2019-07-07T20:19:21Z",
                        "subject": "/CN=example.com",
                        "sha1": "FA:B0:E3:47:C5:FB:5F:15:93:75:94:9B:3F:52:F6:DD:66:02:CF:CF",
                        "sha256": "DF:2E:C5:ED:46:3F:56:58:A6:E4:0C:4D:6F:6B:1A:5C:AE:80:1F:BC:79:5D:E8:04:34:A3:22:D4:C8:5C:55:DB",
                        "private_key_type": "RSA",
                        "private_key_size": 2048,
                        "is_trusted_ca": true,
                        "is_self_signed": false,
                        "is_outdated": true,
                        "is_future": false,
                        "details": [
                            {
                                "subject": "/CN=example.com",
                                "issuer": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "not_valid_before": "2019-04-08T20:19:21Z",
                                "not_valid_after": "2019-07-07T20:19:21Z"
                            },
                            {
                                "subject": "/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2016-03-17T16:40:46Z",
                                "not_valid_after": "2021-03-17T16:40:46Z"
                            },
                            {
                                "subject": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "issuer": "/O=Digital Signature Trust Co./CN=DST Root CA X3",
                                "not_valid_before": "2000-09-30T21:12:19Z",
                                "not_valid_after": "2021-09-30T14:01:15Z"
                            }
                        ]
                    }
                ],
                "file_errors": [],
                "errors": null,
                "domain_errors": null
            }
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

certrequest_remove

Remove certificate request.

Added

v1.2.1

Parameters

Number request id

Return Values

RequestSuccess

Example

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

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

{"method":"certrequest_remove","params":[334],"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":"certrequest_remove","params":[334],"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":"certrequest_remove","params":[334],"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":"certrequest_remove","params":[334],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certrequest_remove","params":[334],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_remove","params":[334],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_remove","params":[334],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_remove","params":[334],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_remove","params":[334],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    334
]

certrequest_upload

Create new certificate request by uploading PEM encoded certificate and private key.

Added

v1.2.1

Parameters

String certificate or chain certificates, String private keys

Return Values

CertificateRequest

Example

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

{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}
Copy
POST /request/client/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 305
X-Qrator-Auth: aabbccddeeff

{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 206

{"result":{"id":335,"type":"upload","created":1600941096,"status":"new","domain_id":null,"hostnames":null,"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/client/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"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":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}' --quiet -O -
Copy
{"result":{"id":335,"type":"upload","created":1600941096,"status":"new","domain_id":null,"hostnames":null,"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}'
Copy
$ curl https://api.qrator.net/request/client/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}'
Copy
{"result":{"id":335,"type":"upload","created":1600941096,"status":"new","domain_id":null,"hostnames":null,"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"id":335,"type":"upload","created":1600941096,"status":"new","domain_id":None,"hostnames":None,"result":{"chains":None,"file_errors":None,"errors":None,"domain_errors":None}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"certrequest_upload","params":["-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----","-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"id":335,"type":"upload","created":1600941096,"status":"new","domain_id":null,"hostnames":null,"result":{"chains":null,"file_errors":null,"errors":null,"domain_errors":null}},"error":null,"id":1}
Copy
{
    "result": {
        "id": 335,
        "type": "upload",
        "created": 1600941096,
        "status": "new",
        "domain_id": null,
        "hostnames": null,
        "result": {
            "chains": null,
            "file_errors": null,
            "errors": null,
            "domain_errors": null
        }
    },
    "error": null,
    "id": 1
}
Copy
[
    "-----BEGIN CERTIFICATE-----\nMIIFWTCCBEGgAwIBAgISBGVdsU0sz+nFwv3lDHIxWhMJMA0GCSqGSIb3DQEBCwUA\n...\n-----END CERTIFICATE-----",
    "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC4+CxjwUvKm7aU\n...\n-----END PRIVATE KEY-----"
]

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
  • NotBanned: 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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"ip_status","params":"198.51.100.12","id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ip_status","params":"198.51.100.12","id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"1":"Allowed","2":"Banned"},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":"198.51.100.12","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":"198.51.100.12","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"1":"Allowed","2":"Banned"},"error":null,"id":1}
Copy
{
    "result": {
        "1": "Allowed",
        "2": "Banned"
    },
    "error": null,
    "id": 1
}
Copy
"198.51.100.12"

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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"pong","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}
Copy
null

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: 65

{"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
import requests

url="https://api.qrator.net/request/client/1"
payload={"method":"source_ips_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/client/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"source_ips_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1/32","198.51.100.0/24"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"source_ips_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/client/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"source_ips_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

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 Name

domain_name_get

Returns current domain name.

Deprecated

v1.1.2

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_name_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_name_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"example.com","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"example.com","error":null,"id":1}
Copy
{
    "result": "example.com",
    "error": null,
    "id": 1
}
Copy
null

domain_name_set

Sets name for domain

Deprecated

v1.1.2

Parameters

String

Return Values

RequestSuccess

Example

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

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

{"method":"domain_name_set","params":"example.com","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_name_set","params":"example.com","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_set","params":"example.com","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_name_set","params":"example.com","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_set","params":"example.com","id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_name_set","params":"example.com","id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_name_set","params":"example.com","id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
"example.com"

name_get

Returns current domain name.

Replacement for domain_name_get and service_name_get methods

Added

v1.1.2

Parameters

None

Return Values

String

Example

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

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

{"method":"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":"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":"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":"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":"name_get","params":null,"id":1}'
Copy
{"result":"example.com","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"name_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"name_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"example.com","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"example.com","error":null,"id":1}
Copy
{
    "result": "example.com",
    "error": null,
    "id": 1
}
Copy
null

name_set

Sets name for domain

Replacement for domain_name_set and service_name_set methods

Added

v1.1.2

Parameters

String

Return Values

RequestSuccess

Example

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

{"method":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"name_set","params":"example.com","id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"name_set","params":"example.com","id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"name_set","params":"example.com","id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
"example.com"

Domain Status

domain_status_get

Returns current domain status.

Deprecated

v1.1.2

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_status_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_status_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"online","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}
Copy
null

not_whitelisted_policy_get

Returns current AccessPolicy.

Parameters

None

Return Values

AccessPolicy

Example

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

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

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

{"result":"accept","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"not_whitelisted_policy_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":"not_whitelisted_policy_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"accept","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"not_whitelisted_policy_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":"not_whitelisted_policy_get","params":null,"id":1}'
Copy
{"result":"accept","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"not_whitelisted_policy_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"not_whitelisted_policy_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"accept","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"accept","error":null,"id":1}
Copy
{
    "result": "accept",
    "error": null,
    "id": 1
}
Copy
null

not_whitelisted_policy_set

Sets current AccessPolicy.

Parameters

AccessPolicy

Return Values

RequestSuccess

Example

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

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

{"method":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"not_whitelisted_policy_set","params":["accept"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"not_whitelisted_policy_set","params":["accept"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "accept"
]

status_get

Returns current resource status.

Replacement for domain_status_get and service_status_get methods

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: 44

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

{"method":"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":"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":"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":"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":"status_get","params":null,"id":1}'
Copy
{"result":"online","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"status_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"status_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"online","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}
Copy
null

Domain IP

domain_ip_get

Returns current upstreams IPs as JSON configuration.

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: 305

{"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 name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]},"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 name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]},"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 name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_ip_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_ip_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
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 name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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 name just for you"},{"type":"primary","ip":"127.255.255.254","weight":1,"name":"test"}]},"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 name just for you"
            },
            {
                "type": "primary",
                "ip": "127.255.255.254",
                "weight": 1,
                "name": "test"
            }
        ]
    },
    "error": null,
    "id": 1
}
Copy
null

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_ip_get_list","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_ip_get_list","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["127.0.0.1","127.255.255.254"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_get_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_get_list","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_set","params":["127.0.0.1","127.255.255.254"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "127.0.0.1",
    "127.255.255.254"
]

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"error":None,"warning":[],"object":["127.0.0.1","127.255.255.254"]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"domain_ip_test","params":["127.0.0.1","127.255.255.254"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
[
    "127.0.0.1",
    "127.255.255.254"
]

Whitelist

whitelist_append

Added given IP addresses to whitelist.

This method supports TimedIP with comments.

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: 118

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

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "some comment"
    ]
]

whitelist_count

Returns count of IPs in whitelist.

Added

v1.3.6

Parameters

None

Return Values

Number

Example

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

{"method":"whitelist_count","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":"whitelist_count","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":12,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_count","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_count","params":null,"id":1}' --quiet -O -
Copy
{"result":12,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_count","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_count","params":null,"id":1}'
Copy
{"result":12,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_count","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_count","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":12,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":12,"error":null,"id":1}
Copy
{
    "result": 12,
    "error": null,
    "id": 1
}
Copy
null

whitelist_flush

Removes all IP addresses from whitelist.

Added

v1.3.6

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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_flush","params":null,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_flush","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_flush","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
null

whitelist_get

Returns whitelist contents.

This method supports TimedIP with comments when used with "tuple" parameter.

Parameters

None or TimedIpMode, default value is "legacy"

Return Values

TimedIPList or TimedIPList with comments

Example

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

{"method":"whitelist_get","params":["tuple"],"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":"whitelist_get","params":["tuple"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 138

{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_get","params":["tuple"],"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":["tuple"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_get","params":["tuple"],"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":["tuple"],"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_get","params":["tuple"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_get","params":["tuple"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ],
        [
            "198.51.100.21",
            720,
            "some comment"
        ],
        [
            "198.51.100.22",
            0,
            "some comment"
        ]
    ],
    "error": null,
    "id": 1
}
Copy
[
    "tuple"
]

whitelist_relay_append

Added given IP addresses to whitelist.

This method supports TimedIP without comments.

Added

v1.4.0

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

{"method":"whitelist_relay_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: 87
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_relay_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_relay_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_relay_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_relay_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_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

whitelist_remove

Removes given IP addresses from 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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

Blacklist

blacklist_append

Added given IP addresses to blacklist.

This method supports TimedIP with comments.

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: 118

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

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "some comment"
    ]
]

blacklist_check

Checks if given IP address is blacklisted or not.

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

blacklist_count

Returns count of blocked IPs by client (API/Dashboard).

Parameters

None

Return Values

Number

Example

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

{"method":"blacklist_count","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_count","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":10,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_count","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_count","params":null,"id":1}' --quiet -O -
Copy
{"result":10,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_count","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_count","params":null,"id":1}'
Copy
{"result":10,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_count","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_count","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":10,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":10,"error":null,"id":1}
Copy
{
    "result": 10,
    "error": null,
    "id": 1
}
Copy
null

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_flush","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_flush","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
null

blacklist_get

Returns blacklist contents.

This method supports TimedIP with comments when used with "tuple" parameter.

Parameters

None or TimedIpMode, default value is "legacy"

Return Values

TimedIPList or TimedIPList with comments

Example

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

{"method":"blacklist_get","params":["tuple"],"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":"blacklist_get","params":["tuple"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 138

{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_get","params":["tuple"],"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":["tuple"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_get","params":["tuple"],"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":["tuple"],"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_get","params":["tuple"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_get","params":["tuple"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ],
        [
            "198.51.100.21",
            720,
            "some comment"
        ],
        [
            "198.51.100.22",
            0,
            "some comment"
        ]
    ],
    "error": null,
    "id": 1
}
Copy
[
    "tuple"
]

blacklist_relay_ban

Added given IP addresses to blacklist.

This method supports TimedIP without comments.

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

{"method":"blacklist_relay_ban","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: 84
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_relay_ban","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_relay_ban","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_relay_ban","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_relay_ban","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_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

blacklist_remove

Removes given IP addresses from 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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

blacklist_status

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

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

Statistics

statistics_billable

Returns billable traffic (Mbps) for given month.

This method uses new statistics storage (same as personal cabinet)

Added

v1.1.2

Parameters

Month or NULL (for current month)

Return Values

Number

Example

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

{"method":"statistics_billable","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_billable","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":12,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_billable","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_billable","params":null,"id":1}' --quiet -O -
Copy
{"result":12,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_billable","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_billable","params":null,"id":1}'
Copy
{"result":12,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_billable","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_billable","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":12,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_billable","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_billable","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":12,"error":null,"id":1}
Copy
{
    "result": 12,
    "error": null,
    "id": 1
}
Copy
null

statistics_current_blocks

Returns current blocks made by Qrator, Qrator.Antibot or WAF

Added

v1.2.2

Parameters

None

Return Values

StatisticsCurrentBlocks

Example

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

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

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

{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_blocks","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_current_blocks","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_blocks","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_current_blocks","params":null,"id":1}'
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_current_blocks","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_blocks","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_blocks","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_blocks","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1606828607,
        "Qrator401": 28.2,
        "Qrator403": 0.3,
        "Waf403": 0.13,
        "Qrator503Con": 32.44,
        "Qrator503Req": 40.28
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_dns

Returns latest DNS-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Added

v1.3.1

Parameters

None

Return Values

StatisticsCurrentDNS

Example

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

{"method":"statistics_current_dns","params":null,"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":"statistics_current_dns","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 446

{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_dns","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_current_dns","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_dns","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_current_dns","params":null,"id":1}'
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_current_dns","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_dns","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_dns","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_dns","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1649941740,
        "cache": {
            "hit": 18.88333333333334
        },
        "requests": {
            "upstream": 0.05,
            "invalid": 0,
            "types": {
                "A": 13.833333333333332,
                "AAAA": 4.699999999999997,
                "ANY": 0,
                "CNAME": 0,
                "NS": 0.08333333333333333,
                "SOA": 0.016666666666666666,
                "TXT": 0
            },
            "protocol": {
                "tcp": 1.3333333333333335,
                "udp": 17.616666666666667
            }
        },
        "errors_user": {
            "NXDOMAIN": 0.08333333333333333,
            "SERVFAIL": 0
        },
        "errors_upstream": {
            "Connect": 0,
            "Recv": 0,
            "Send": 0,
            "Timeout": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_http

Returns latest HTTP-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Parameters

None

Return Values

StatisticsCurrentHTTP

Example

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

{"method":"statistics_current_http","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":"statistics_current_http","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 257

{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_http","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_current_http","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_http","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_current_http","params":null,"id":1}'
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_current_http","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_http","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_http","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_http","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1563204000,
        "requests": 0,
        "responses": {
            "0000_0200": 0,
            "0200_0500": 0,
            "0500_0700": 0,
            "0700_1000": 0,
            "1000_1500": 0,
            "1500_2000": 0,
            "2000_5000": 0,
            "5000_inf": 0
        },
        "errors": {
            "total": 0,
            "500": 0,
            "501": 0,
            "502": 0,
            "503": 0,
            "504": 0,
            "4xx": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_ip

Returns latest IP-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Parameters

None

Return Values

StatisticsCurrentIP

Example

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

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

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

{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_ip","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_current_ip","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_ip","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_current_ip","params":null,"id":1}'
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_current_ip","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_ip","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_ip","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_ip","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1563204000,
        "bandwidth": {
            "input": 0,
            "passed": 0,
            "output": 0
        },
        "packets": {
            "input": 0,
            "passed": 0,
            "output": 0
        },
        "blacklist": {
            "qrator": 0,
            "api": 0,
            "waf": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_locations

Return current Geo-locations for IPs blacklist

Added

v1.2.2

Parameters

None

Return Values

StatisticsCurrentLocations

Example

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

{"method":"statistics_current_locations","params":null,"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":"statistics_current_locations","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 109

{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_locations","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_current_locations","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_locations","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_current_locations","params":null,"id":1}'
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_current_locations","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_locations","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_locations","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_locations","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1606828607,
        "locations": {
            "A1": 341.5,
            "RU": 65.3,
            "ID": 49,
            "US": 27,
            "BR": 26
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_get

Returns latest statistics snapshot.

This method uses legacy statistics storage use statistics_current_ip, statistics_current_http, statistics_billable methods.

Deprecated

v1.1.2

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
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":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

statistics_get_lite

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

This method uses legacy statistics storage use statistics_current_ip and statistics_current_http methods.

Deprecated

v1.1.2

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"statistics_get_lite","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_get_lite","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
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":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get_lite","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get_lite","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

Certificate storage

sni_clear

Totally removes SNI-state (set of links) for resource.

This method will remove all certificate links, so resource will not have any certificates, that will lead to fully disabled HTTPS resource.
This method returns response as soon as possible, but calling this method more then once a minute is strongly not recommended.

Added

v1.4.1

Parameters

None

Return Values

RequestSuccess

sni_get

Get current SNI configuration

Added

v1.2.1

Parameters

None

Return Values

CertificateLinkList

Example

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

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

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

{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"sni_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":"sni_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"sni_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":"sni_get","params":null,"id":1}'
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"sni_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"sni_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"link_id":1100,"port":443,"hostname":None,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "link_id": 1100,
            "port": 443,
            "hostname": null,
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1101,
            "port": 443,
            "hostname": "example.com",
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1102,
            "port": 443,
            "hostname": "*.example.com",
            "domain_id": 1,
            "certificate": 320
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

Add single SNI certificate-hostname record. If same link (port-hostname) exists - it will be overwritten

Added

v1.2.1

Parameters

Number port, Number certificate id, String hostname or NULL (for default hostname)

Return Values

CertificateLinkList

Example

Remove single SNI certificate-hostname record.

Added

v1.2.1

Parameters

Number link id

Return Values

CertificateLinkList

Example

sni_set

Sets full SNI-state (set of links) for resource.

This method always overwrites current saved state with given.
This method returns response as soon as possible, but calling this method more then once a minute is strongly not recommended.

Added

v1.4.1

Parameters

CertificateSniState

Return Values

CertificateLinkList

Example

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

{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
Copy
POST /request/domain/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 201
X-Qrator-Auth: aabbccddeeff

{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 282

{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/domain/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"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":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}' --quiet -O -
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}'
Copy
$ curl https://api.qrator.net/request/domain/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}'
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":None},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":None},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"link_id":2101,"port":443,"hostname":None,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "link_id": 2101,
            "port": 443,
            "hostname": null,
            "domain_id": 1,
            "certificate": 420
        },
        {
            "link_id": 2102,
            "port": 443,
            "hostname": "example.com",
            "domain_id": 1,
            "certificate": 420
        },
        {
            "link_id": 2103,
            "port": 443,
            "hostname": "www.example.com",
            "domain_id": 1,
            "certificate": 421
        }
    ],
    "error": null,
    "id": 1
}
Copy
[
    {
        "port": 443,
        "certificate": 420,
        "hostname": null
    },
    {
        "port": 443,
        "certificate": 420,
        "hostname": "example.com"
    },
    {
        "port": 443,
        "certificate": 421,
        "hostname": "www.example.com"
    }
]

Troubleshoot

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
  • NotBanned: 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: 42

{"result":"NotBanned","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":"NotBanned","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":"NotBanned","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"ip_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ip_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"pong","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}
Copy
null

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
import requests

url="https://api.qrator.net/request/domain/1"
payload={"method":"troubleshoot_traceroute","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/domain/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"troubleshoot_traceroute","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"... a lot of trace lines ...","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"troubleshoot_traceroute","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/domain/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"troubleshoot_traceroute","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"... a lot of trace lines ...","error":null,"id":1}
Copy
{
    "result": "... a lot of trace lines ...",
    "error": null,
    "id": 1
}
Copy
null

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 Name

name_get

Returns current domain name.

Replacement for domain_name_get and service_name_get methods

Added

v1.1.2

Parameters

None

Return Values

String

Example

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

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

{"method":"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/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"name_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":"name_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"example.com","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"name_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":"name_get","params":null,"id":1}'
Copy
{"result":"example.com","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"name_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"name_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"example.com","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"example.com","error":null,"id":1}
Copy
{
    "result": "example.com",
    "error": null,
    "id": 1
}
Copy
null

name_set

Sets name for domain

Replacement for domain_name_set and service_name_set methods

Added

v1.1.2

Parameters

String

Return Values

RequestSuccess

Example

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

{"method":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","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":"name_set","params":"example.com","id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"name_set","params":"example.com","id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"name_set","params":"example.com","id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"name_set","params":"example.com","id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
"example.com"

service_name_get

Returns current service name.

Deprecated

v1.1.2

Parameters

None

Return Values

String

Example

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

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

{"method":"service_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/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"service_name_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_name_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"example.com","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"service_name_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_name_get","params":null,"id":1}'
Copy
{"result":"example.com","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_name_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_name_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"example.com","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_name_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"example.com","error":null,"id":1}
Copy
{
    "result": "example.com",
    "error": null,
    "id": 1
}
Copy
null

service_name_set

Sets name for service

Deprecated

v1.1.2

Parameters

String

Return Values

RequestSuccess

Example

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

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

{"method":"service_name_set","params":"example.com","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_name_set","params":"example.com","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_name_set","params":"example.com","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_name_set","params":"example.com","id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"service_name_set","params":"example.com","id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_name_set","params":"example.com","id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_name_set","params":"example.com","id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_name_set","params":"example.com","id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
"example.com"

Service Status

not_whitelisted_policy_get

Returns current AccessPolicy.

Parameters

None

Return Values

AccessPolicy

Example

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

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

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

{"result":"accept","error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"not_whitelisted_policy_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":"not_whitelisted_policy_get","params":null,"id":1}' --quiet -O -
Copy
{"result":"accept","error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"not_whitelisted_policy_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":"not_whitelisted_policy_get","params":null,"id":1}'
Copy
{"result":"accept","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"not_whitelisted_policy_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"not_whitelisted_policy_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"accept","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"accept","error":null,"id":1}
Copy
{
    "result": "accept",
    "error": null,
    "id": 1
}
Copy
null

not_whitelisted_policy_set

Sets current AccessPolicy.

Parameters

AccessPolicy

Return Values

RequestSuccess

Example

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

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

{"method":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"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":"not_whitelisted_policy_set","params":["accept"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"not_whitelisted_policy_set","params":["accept"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"not_whitelisted_policy_set","params":["accept"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"not_whitelisted_policy_set","params":["accept"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "accept"
]

service_status_get

Returns current domain status.

Deprecated

v1.1.2

Parameters

None

Return Values

Enum with value from following list:

  • offline: service is offline
  • online: service is online
  • pending: some operations are performed on the service
  • 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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_status_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_status_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"online","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}
Copy
null

status_get

Returns current resource status.

Replacement for domain_status_get and service_status_get methods

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: 44

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

{"method":"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":"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":"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":"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":"status_get","params":null,"id":1}'
Copy
{"result":"online","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"status_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"status_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"online","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"online","error":null,"id":1}
Copy
{
    "result": "online",
    "error": null,
    "id": 1
}
Copy
null

status_set

Sets service status online/offline

Added

v1.2.7

Parameters

String "online" or "offline"

Return Values

RequestSuccess

Example

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

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

{"method":"status_set","params":["online"],"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":"status_set","params":["online"],"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":"status_set","params":["online"],"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":"status_set","params":["online"],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"status_set","params":["online"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"status_set","params":["online"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"status_set","params":["online"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_set","params":["online"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"status_set","params":["online"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "online"
]

Service IP

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: 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_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"],"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"],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ip_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ip_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

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: 73

{"method":"service_ip_set","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: 73
X-Qrator-Auth: aabbccddeeff

{"method":"service_ip_set","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":"service_ip_set","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_set","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":"service_ip_set","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_set","params":["192.0.2.1","198.51.100.12"],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ip_set","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ip_set","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_set","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_set","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1","198.51.100.12"],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ip_test","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

Service Ports

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ports_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ports_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_set","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
{
    "80": [
        "http"
    ],
    "443": [
        "http"
    ],
    "53": [
        "tcp",
        "udp"
    ],
    "22": [
        "tcp"
    ]
}

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"22":["tcp"],"53":["tcp","udp"],"80":["http"],"443":["http"]},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"service_ports_test","params":{"80":["http"],"443":["http"],"53":["tcp","udp"],"22":["tcp"]},"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
{
    "80": [
        "http"
    ],
    "443": [
        "http"
    ],
    "53": [
        "tcp",
        "udp"
    ],
    "22": [
        "tcp"
    ]
}

Whitelist

whitelist_append

Added given IP addresses to whitelist.

This method supports TimedIP with comments.

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: 118

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

{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "some comment"
    ]
]

whitelist_count

Returns count of IPs in whitelist.

Added

v1.3.6

Parameters

None

Return Values

Number

Example

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

{"method":"whitelist_count","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":"whitelist_count","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":12,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_count","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_count","params":null,"id":1}' --quiet -O -
Copy
{"result":12,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_count","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_count","params":null,"id":1}'
Copy
{"result":12,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_count","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_count","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":12,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":12,"error":null,"id":1}
Copy
{
    "result": 12,
    "error": null,
    "id": 1
}
Copy
null

whitelist_flush

Removes all IP addresses from whitelist.

Added

v1.3.6

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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_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":"whitelist_flush","params":null,"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_flush","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_flush","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
null

whitelist_get

Returns whitelist contents.

This method supports TimedIP with comments when used with "tuple" parameter.

Parameters

None or TimedIpMode, default value is "legacy"

Return Values

TimedIPList or TimedIPList with comments

Example

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

{"method":"whitelist_get","params":["tuple"],"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":"whitelist_get","params":["tuple"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 138

{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"whitelist_get","params":["tuple"],"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":["tuple"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"whitelist_get","params":["tuple"],"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":["tuple"],"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_get","params":["tuple"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_get","params":["tuple"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ],
        [
            "198.51.100.21",
            720,
            "some comment"
        ],
        [
            "198.51.100.22",
            0,
            "some comment"
        ]
    ],
    "error": null,
    "id": 1
}
Copy
[
    "tuple"
]

whitelist_relay_append

Added given IP addresses to whitelist.

This method supports TimedIP without comments.

Added

v1.4.0

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

{"method":"whitelist_relay_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: 87
X-Qrator-Auth: aabbccddeeff

{"method":"whitelist_relay_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_relay_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_relay_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_relay_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_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_relay_append","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

whitelist_remove

Removes given IP addresses from 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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"whitelist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

Blacklist

blacklist_append

Added given IP addresses to blacklist.

This method supports TimedIP with comments.

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: 118

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

{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"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],["198.51.100.21",720,"some comment"]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_append","params":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ],
    [
        "198.51.100.21",
        720,
        "some comment"
    ]
]

blacklist_check

Checks if given IP address is blacklisted or not.

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_check","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_check","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

blacklist_count

Returns count of blocked IPs by client (API/Dashboard).

Parameters

None

Return Values

Number

Example

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

{"method":"blacklist_count","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_count","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 33

{"result":10,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_count","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_count","params":null,"id":1}' --quiet -O -
Copy
{"result":10,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_count","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_count","params":null,"id":1}'
Copy
{"result":10,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_count","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_count","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":10,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_count","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":10,"error":null,"id":1}
Copy
{
    "result": 10,
    "error": null,
    "id": 1
}
Copy
null

blacklist_flush

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

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_flush","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_flush","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_flush","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
null

blacklist_get

Returns blacklist contents.

This method supports TimedIP with comments when used with "tuple" parameter.

Parameters

None or TimedIpMode, default value is "legacy"

Return Values

TimedIPList or TimedIPList with comments

Example

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

{"method":"blacklist_get","params":["tuple"],"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":"blacklist_get","params":["tuple"],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 138

{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"blacklist_get","params":["tuple"],"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":["tuple"],"id":1}' --quiet -O -
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"blacklist_get","params":["tuple"],"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":["tuple"],"id":1}'
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_get","params":["tuple"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_get","params":["tuple"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_get","params":["tuple"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":["192.0.2.1",["198.51.100.12",720],["198.51.100.21",720,"some comment"],["198.51.100.22",0,"some comment"]],"error":null,"id":1}
Copy
{
    "result": [
        "192.0.2.1",
        [
            "198.51.100.12",
            720
        ],
        [
            "198.51.100.21",
            720,
            "some comment"
        ],
        [
            "198.51.100.22",
            0,
            "some comment"
        ]
    ],
    "error": null,
    "id": 1
}
Copy
[
    "tuple"
]

blacklist_relay_ban

Added given IP addresses to blacklist.

This method supports TimedIP without comments.

Parameters

IPList or TimedIPList, max 300 elements in list

Return Values

RequestSuccess

Example

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

{"method":"blacklist_relay_ban","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: 84
X-Qrator-Auth: aabbccddeeff

{"method":"blacklist_relay_ban","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_relay_ban","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_relay_ban","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_relay_ban","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_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}'
Copy
{"result":"Successful","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_relay_ban","params":["192.0.2.1",["198.51.100.12",720]],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    [
        "198.51.100.12",
        720
    ]
]

blacklist_remove

Removes given IP addresses from blacklist.

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"Successful","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_remove","params":["192.0.2.1","198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"Successful","error":null,"id":1}
Copy
{
    "result": "Successful",
    "error": null,
    "id": 1
}
Copy
[
    "192.0.2.1",
    "198.51.100.12"
]

blacklist_status

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

If given IP exists both in Blacklist and Whitelist, this method will return "NotBanned"

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"blacklist_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"blacklist_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

Statistics

statistics_billable

Returns billable traffic (Mbps) for given month.

This method uses new statistics storage (same as personal cabinet)

Added

v1.1.2

Parameters

Month or NULL (for current month)

Return Values

Number

Example

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

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

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

{"result":12,"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_billable","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_billable","params":null,"id":1}' --quiet -O -
Copy
{"result":12,"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_billable","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_billable","params":null,"id":1}'
Copy
{"result":12,"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_billable","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_billable","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":12,"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_billable","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_billable","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":12,"error":null,"id":1}
Copy
{
    "result": 12,
    "error": null,
    "id": 1
}
Copy
null

statistics_current_blocks

Returns current blocks made by Qrator, Qrator.Antibot or WAF

Added

v1.2.2

Parameters

None

Return Values

StatisticsCurrentBlocks

Example

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

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

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

{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_blocks","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_current_blocks","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_blocks","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_current_blocks","params":null,"id":1}'
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_current_blocks","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_blocks","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_blocks","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_blocks","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1606828607,"Qrator401":28.2,"Qrator403":0.3,"Waf403":0.13,"Qrator503Con":32.44,"Qrator503Req":40.28},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1606828607,
        "Qrator401": 28.2,
        "Qrator403": 0.3,
        "Waf403": 0.13,
        "Qrator503Con": 32.44,
        "Qrator503Req": 40.28
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_dns

Returns latest DNS-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Added

v1.3.1

Parameters

None

Return Values

StatisticsCurrentDNS

Example

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

{"method":"statistics_current_dns","params":null,"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":"statistics_current_dns","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 446

{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_dns","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_current_dns","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_dns","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_current_dns","params":null,"id":1}'
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_current_dns","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_dns","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_dns","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_dns","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1649941740,"cache":{"hit":18.88333333333334},"requests":{"upstream":0.05,"invalid":0,"types":{"A":13.833333333333332,"AAAA":4.699999999999997,"ANY":0,"CNAME":0,"NS":0.08333333333333333,"SOA":0.016666666666666666,"TXT":0},"protocol":{"tcp":1.3333333333333335,"udp":17.616666666666667}},"errors_user":{"NXDOMAIN":0.08333333333333333,"SERVFAIL":0},"errors_upstream":{"Connect":0,"Recv":0,"Send":0,"Timeout":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1649941740,
        "cache": {
            "hit": 18.88333333333334
        },
        "requests": {
            "upstream": 0.05,
            "invalid": 0,
            "types": {
                "A": 13.833333333333332,
                "AAAA": 4.699999999999997,
                "ANY": 0,
                "CNAME": 0,
                "NS": 0.08333333333333333,
                "SOA": 0.016666666666666666,
                "TXT": 0
            },
            "protocol": {
                "tcp": 1.3333333333333335,
                "udp": 17.616666666666667
            }
        },
        "errors_user": {
            "NXDOMAIN": 0.08333333333333333,
            "SERVFAIL": 0
        },
        "errors_upstream": {
            "Connect": 0,
            "Recv": 0,
            "Send": 0,
            "Timeout": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_http

Returns latest HTTP-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Parameters

None

Return Values

StatisticsCurrentHTTP

Example

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

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

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

{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_http","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_current_http","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_http","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_current_http","params":null,"id":1}'
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_current_http","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_http","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_http","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_http","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1563204000,"requests":0,"responses":{"0000_0200":0,"0200_0500":0,"0500_0700":0,"0700_1000":0,"1000_1500":0,"1500_2000":0,"2000_5000":0,"5000_inf":0},"errors":{"total":0,"500":0,"501":0,"502":0,"503":0,"504":0,"4xx":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1563204000,
        "requests": 0,
        "responses": {
            "0000_0200": 0,
            "0200_0500": 0,
            "0500_0700": 0,
            "0700_1000": 0,
            "1000_1500": 0,
            "1500_2000": 0,
            "2000_5000": 0,
            "5000_inf": 0
        },
        "errors": {
            "total": 0,
            "500": 0,
            "501": 0,
            "502": 0,
            "503": 0,
            "504": 0,
            "4xx": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_ip

Returns latest IP-statistics snapshot.

This method uses new statistics storage (same as personal cabinet)

Parameters

None

Return Values

StatisticsCurrentIP

Example

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

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

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

{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_ip","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_current_ip","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_ip","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_current_ip","params":null,"id":1}'
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_current_ip","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_ip","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_ip","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_ip","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1563204000,"bandwidth":{"input":0,"passed":0,"output":0},"packets":{"input":0,"passed":0,"output":0},"blacklist":{"qrator":0,"api":0,"waf":0}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1563204000,
        "bandwidth": {
            "input": 0,
            "passed": 0,
            "output": 0
        },
        "packets": {
            "input": 0,
            "passed": 0,
            "output": 0
        },
        "blacklist": {
            "qrator": 0,
            "api": 0,
            "waf": 0
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_current_locations

Return current Geo-locations for IPs blacklist

Added

v1.2.2

Parameters

None

Return Values

StatisticsCurrentLocations

Example

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

{"method":"statistics_current_locations","params":null,"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":"statistics_current_locations","params":null,"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 109

{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"statistics_current_locations","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_current_locations","params":null,"id":1}' --quiet -O -
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_current_locations","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_current_locations","params":null,"id":1}'
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_current_locations","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_current_locations","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_locations","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_current_locations","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":{"time":1606828607,"locations":{"A1":341.5,"RU":65.3,"ID":49,"US":27,"BR":26}},"error":null,"id":1}
Copy
{
    "result": {
        "time": 1606828607,
        "locations": {
            "A1": 341.5,
            "RU": 65.3,
            "ID": 49,
            "US": 27,
            "BR": 26
        }
    },
    "error": null,
    "id": 1
}
Copy
null

statistics_get

Returns latest statistics snapshot.

This method uses legacy statistics storage use statistics_current_ip, statistics_current_http, statistics_billable methods.

Deprecated

v1.1.2

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: 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/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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
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":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

statistics_get_lite

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

This method uses legacy statistics storage use statistics_current_ip and statistics_current_http methods.

Deprecated

v1.1.2

Parameters

None

Return Values

StatisticsResponseLite

Example

Copy
POST /request/service/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/service/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/service/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/service/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/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"statistics_get_lite","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_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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"statistics_get_lite","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"statistics_get_lite","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
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":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get_lite","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"statistics_get_lite","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
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
}
Copy
null

Certificate storage

sni_clear

Totally removes SNI-state (set of links) for resource.

This method will remove all certificate links, so resource will not have any certificates, that will lead to fully disabled HTTPS resource.
This method returns response as soon as possible, but calling this method more then once a minute is strongly not recommended.

Added

v1.4.1

Parameters

None

Return Values

RequestSuccess

sni_get

Get current SNI configuration

Added

v1.2.1

Parameters

None

Return Values

CertificateLinkList

Example

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

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

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

{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"sni_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":"sni_get","params":null,"id":1}' --quiet -O -
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"sni_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":"sni_get","params":null,"id":1}'
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"sni_get","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"sni_get","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"link_id":1100,"port":443,"hostname":None,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_get","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"link_id":1100,"port":443,"hostname":null,"domain_id":1,"certificate":320},{"link_id":1101,"port":443,"hostname":"example.com","domain_id":1,"certificate":320},{"link_id":1102,"port":443,"hostname":"*.example.com","domain_id":1,"certificate":320}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "link_id": 1100,
            "port": 443,
            "hostname": null,
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1101,
            "port": 443,
            "hostname": "example.com",
            "domain_id": 1,
            "certificate": 320
        },
        {
            "link_id": 1102,
            "port": 443,
            "hostname": "*.example.com",
            "domain_id": 1,
            "certificate": 320
        }
    ],
    "error": null,
    "id": 1
}
Copy
null

Add single SNI certificate-hostname record. If same link (port-hostname) exists - it will be overwritten

Added

v1.2.1

Parameters

Number port, Number certificate id, String hostname or NULL (for default hostname)

Return Values

CertificateLinkList

Example

Remove single SNI certificate-hostname record.

Added

v1.2.1

Parameters

Number link id

Return Values

CertificateLinkList

Example

sni_set

Sets full SNI-state (set of links) for resource.

This method always overwrites current saved state with given.
This method returns response as soon as possible, but calling this method more then once a minute is strongly not recommended.

Added

v1.4.1

Parameters

CertificateSniState

Return Values

CertificateLinkList

Example

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

{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
Copy
POST /request/service/1 HTTP/1.0
Host: api.qrator.net
Content-Type: application/json
Content-Length: 201
X-Qrator-Auth: aabbccddeeff

{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
Copy
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 282

{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
$ wget https://api.qrator.net/request/service/1 \
  --header='Content-Type: application/json' \
  --post-data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"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":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}' --quiet -O -
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' \
  --data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}'
Copy
$ curl https://api.qrator.net/request/service/1 \
  -H 'Content-Type: application/json' -H "X-Qrator-Auth: aabbccddeeff" \
  --data '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}'
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":None},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":None},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":[{"link_id":2101,"port":443,"hostname":None,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"sni_set","params":[{"port":443,"certificate":420,"hostname":null},{"port":443,"certificate":420,"hostname":"example.com"},{"port":443,"certificate":421,"hostname":"www.example.com"}],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":[{"link_id":2101,"port":443,"hostname":null,"domain_id":1,"certificate":420},{"link_id":2102,"port":443,"hostname":"example.com","domain_id":1,"certificate":420},{"link_id":2103,"port":443,"hostname":"www.example.com","domain_id":1,"certificate":421}],"error":null,"id":1}
Copy
{
    "result": [
        {
            "link_id": 2101,
            "port": 443,
            "hostname": null,
            "domain_id": 1,
            "certificate": 420
        },
        {
            "link_id": 2102,
            "port": 443,
            "hostname": "example.com",
            "domain_id": 1,
            "certificate": 420
        },
        {
            "link_id": 2103,
            "port": 443,
            "hostname": "www.example.com",
            "domain_id": 1,
            "certificate": 421
        }
    ],
    "error": null,
    "id": 1
}
Copy
[
    {
        "port": 443,
        "certificate": 420,
        "hostname": null
    },
    {
        "port": 443,
        "certificate": 420,
        "hostname": "example.com"
    },
    {
        "port": 443,
        "certificate": 421,
        "hostname": "www.example.com"
    }
]

Troubleshoot

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
  • NotBanned: 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: 42

{"result":"NotBanned","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":"NotBanned","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":"NotBanned","error":null,"id":1}
Copy
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"ip_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ip_status","params":["198.51.100.12"],"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"NotBanned","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ip_status","params":["198.51.100.12"],"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"NotBanned","error":null,"id":1}
Copy
{
    "result": "NotBanned",
    "error": null,
    "id": 1
}
Copy
[
    "198.51.100.12"
]

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
import requests

url="https://api.qrator.net/request/service/1"
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, json=payload).json()
print(res)
Copy
import requests

url="https://api.qrator.net/request/service/1"
headers={"x-qrator-auth": "aabbccddeeff"}
payload={"method":"ping","params":None,"id":1}
res=requests.post(url, headers=headers, json=payload).json()
print(res)
Copy
{"result":"pong","error":None,"id":1}
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json"
                ]
            ]
        ]
    )
);
Copy
echo file_get_contents(
    "https://api.qrator.net/request/service/1",
    false,
    stream_context_create(
        [
            "http" => [
                "content" => '{"method":"ping","params":null,"id":1}',
                "method" => "POST",
                "header"  => [
                    "Content-Type: application/json",
                    "x-qrator-auth": "aabbccddeeff"
                ]
            ]
        ]
    )
);
Copy
{"result":"pong","error":null,"id":1}
Copy
{
    "result": "pong",
    "error": null,
    "id": 1
}
Copy
null

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

v1.4.3

Sep 11 2023

Added

v1.4.2

Jul 30 2023

  • Minor backend updates

v1.4.1

Jun 30 2023

Added

v1.4.0

Jun 28 2023

Added

v1.3.16

Jun 22 2023

  • Minor backend updates for speedup whitelist- and blacklist- methods

v1.3.15

Apr 13 2023

  • Minor documentation fixes

v1.3.14

Feb 15 2023

Added

v1.3.13

Feb 13 2023

Added

v1.3.12

07 Feb 2022

Added

v1.3.11

20 Jan 2023

  • Minor backend updates

v1.3.10

20 Jan 2023

v1.3.9

11 Oct 2022

v1.3.8

28 Jul 2022

  • Minor backend fixes

v1.3.7

15 Jul 2022

Added

v1.3.6

14 Jul 2022

  • Some documentation fixes.

Added

v1.3.5

06 Jul 2022

  • Added methods to blacklist IP on all client domains

Added

v1.3.4

17 Jun 2022

  • Added method to remove certificate from Certificate storage

Added

v1.3.3

10 Jun 2022

  • Added method to remove certificate from Certificate storage

Added

v1.3.2

13 May 2022

  • Minor validation fixes

v1.3.1

14 Apr 2022

  • Added method for latest DNS-statistics snapshot

Added

v1.3.0

28 Mar 2022

Added

v1.2.9

Feb 10 2022

  • Minor documentation updates

Added

v1.2.8

Dec 21 2021

Added

v1.2.7

Nov 16 2021

Added

v1.2.6

Aug 10 2021

Added

v1.2.5

Mar 24 2021

  • Updated internal error handling

v1.2.4

Mar 4 2021

  • Minor backend fixes

v1.2.3

Feb 24 2021

v1.2.2

Dec 01 2020

Added

v1.2.1

Sep 23 2020

  • Added methods for our Certificate Storage
  • Added methods for SNI configuration
  • Common workflow to add PEM certificate and use it with SNI:

Added

v1.1.11

Sep 23 2020

  • Some minor documentation fixes.
  • Minor backend stability updates

v1.1.10

May 28 2020

  • Response headers documentation update.

v1.1.9

Mar 26 2020

  • Fixed parameter handling for service_ports_set and service_ports_test methods.

v1.1.8

Jan 21 2020

Added

v1.1.7

Dec 17 2019

  • Auth backend fixes

v1.1.6

Nov 08 2019

  • Fixed some links in documentation

v1.1.5

Nov 06 2019

  • Minor backend updates

v1.1.4

Sep 29 2019

v1.1.3

Aug 02 2019

v1.1.2

Jul 24 2019

  • Major backend updates, fixes and some refactoring:

Added

Deprecated

Removed

  • Removed method domain::test_iplist
  • Removed method domain::test_timediplist
  • Removed method service::test_iplist
  • Removed method service::test_timediplist

v1.0.27

Jun 25 2019

Removed

  • Removed method domain::whitequeue_append
  • Removed method domain::whitequeue_flush
  • Removed method domain::whitequeue_get
  • Removed method domain::whitequeue_get_max_size
  • Removed method domain::whitequeue_get_size
  • Removed method domain::whitequeue_remove
  • Removed method domain::whitequeue_set_max_size

v1.0.26

Jun 10 2019

  • Minor updates of request handler

v1.0.25

May 30 2019

  • Documentation fixes

v1.0.24

May 29 2019

  • Minor fixes

v1.0.23

May 29 2019

  • Some documentation fixes

v1.0.22

Apr 16 2019

  • Minor backend updates

v1.0.21

Feb 14 2019

  • Major improvements for blacklist_... methods

v1.0.20

Dec 18 2018

  • Minor backend updates

v1.0.19

Sep 12 2018

Added

v1.0.18

Mar 01 2018

  • Minor backend updates

v1.0.17

Feb 27 2018

Added

v1.0.15

Dec 4 2017

Added

v1.0.14

Oct 9 2017

Added

v1.0.13

Aug 16 2017

Added

v1.0.12

Jun 28 2017

  • We are planning to drop support for HTTP requests in favour of HTTPS, please update your applications.

Added

  • For our clients and partners now available Debug methods - for testing purposes.

v1.0.11

Jun 27 2017

Added

v1.0.10

Apr 19 2017

Added

v1.0.9

Apr 11 2017

Added

v1.0.8

Feb 01 2017

Added

v1.0.7

Dec 23 2016

Added

v1.0.6

Dec 07 2016

Added

v1.0.5

Nov 17 2016

Added

v1.0.4

Sep 20 2016

Added

v1.0.3

Aug 10 2016

Added

v1.0.2

Aug 2 2016

Added