WAPI – Manual

On this pageWEDOS API (WAPI)Activating WAPIIntegrating WAPI into Your SystemBasic RequestsSolving Common ProblemsFrequently Asked Questions

This article explains what WAPI is, how to activate it in the WEDOS Global administration and how to send your first request. The commands for individual services are described in separate articles, for example WAPI – WEDOS Protection (WGP).

In this article, you will learn:


WEDOS API (WAPI)

WEDOS API, or WAPI for short, lets you manage WEDOS services directly from your own system using requests and responses.

WAPI is an interface for programs, not for people. Instead of clicking in the administration, your script or application sends a request to WAPI (for example, “list my domains”) and receives a response with the result. Every response contains a numeric code that tells you whether the request succeeded.

  • Communication is either synchronous (the response usually arrives within a few seconds) or asynchronous (processing takes longer and you track progress through notifications).
  • Data is sent over HTTPS using the POST method in the request parameter, encoded in UTF-8.
  • The supported formats are XML and JSON.

Using WAPI requires an active credit account, from which the system deducts payments for registrations, renewals and other paid operations.

What You Need to Get Started

Before sending your first request, you need:

Start with the ping request. It changes nothing and only verifies your login, WAPI password and IP address. Code 1000 in the response means your connection works. If you get 2050 or 2051, see Solving Common Problems.

Supported Services

WAPI currently supports these WEDOS Global services:

You can also use the services of the WEDOS domain registrar:

The commands of each service are described in separate articles.

WAPI Limits

To prevent abuse, WAPI applies these limits:

  • One user account can send at most 1,000 requests per hour. This applies to all request types. When the limit is reached, WAPI rejects further requests (code 2006) until the time limit expires.
  • One user account can send at most 100 domain availability requests per hour. This applies to domain-check, domain-create and domain-transfer-check.
  • A request can be at most 4 KB (XML and JSON). The exception is wgp-domain-cert-upload with a limit of 64 KB. WAPI rejects a larger request with code 2007.
  • Repeated invalid requests (authentication failure, access from a disallowed IP address, invalid input, missing or incorrect parameters, unknown command, commands ending with an error, or requests exceeding other limits) block the IP address for 1 minute per invalid request once there are more than 10 invalid requests (code 2052). Each further invalid request extends the block.

Synchronous and Asynchronous Requests

Most requests are synchronous: you send a request and usually get the result within a few seconds.

Some requests are asynchronous and can take a very long time to process (even hours or days). In that case, WAPI does not return the final result but code 1001 (request accepted). The system then sends you progress and the final result as notifications.

Return Codes

Every response contains a numeric return code. The most common codes are:

  • 1000 = OK
  • 1001 = request accepted, the result will arrive in a notification
  • 2006 = request limit exceeded
  • 2007 = maximum request size exceeded
  • 2010 = unknown command
  • 2050 = authentication failure
  • 2051 = access from this IP address is not allowed
  • 2052 = IP address temporarily blocked due to too many failed requests
  • 4000 = internal error

Code categories by the first digit:

  • 1xxx = the request succeeded
  • 2xxx = incorrect request (missing or invalid parameters, wrong format or value)
  • 3xxx = target object error: the action cannot be performed because the object is not in the right state (for example, registering a domain that is already taken)
  • 4xxx = error while executing the request (for example, the domain registry is unavailable or communication failed)
  • 5xxx = internal error or state of our system

Code categories by the second digit:

  • x0xx, x1xx = general codes
  • x2xx = domains, contacts, credit account
  • x3xx = DNS
  • x4xx = WEDOS Global and WEDOS Protection

The codes of individual commands are listed in the article for each service; the full list is in WAPI – Response Codes.


Activating WAPI

Before activating WAPI, make sure you have an active WEDOS credit account.

Before you start using WAPI, activate it:

  1. Log in to the WEDOS Global administration ⧉.
  2. In the left panel, select WAPI.
  3. If WAPI is not active yet, check I agree with the terms and conditions of WEDOS services. in the WAPI Activation section.
  4. Click Activate.
  5. In the WAPI settings form, fill in the details and confirm with Set:
    • Allowed IP addresses: comma-separated list of IP addresses (IPv4 and IPv6, CIDR notation supported) from which your system connects to WAPI.
    • Notification mode: how notifications about asynchronous requests are delivered (POLL queue, email or URL).
    • Preferred protocol: format (XML or JSON) of system notifications and of notifications sent by email or to a URL. Responses always use the same format as the request.
  6. In the Password settings form, enter the WAPI password twice and click Set.
Setting allowed IP addresses and a Password for WAPI in WEDOS Global
Setting allowed IP addresses and a Password for WAPI in WEDOS Global

The settings usually take effect immediately, at the latest within a few minutes.

You can change all settings later in the same way. Deleting all allowed IP addresses turns off access to WAPI.


Integrating WAPI into Your System

After activation, you integrate WAPI into your system in these steps:

  1. set up a script to connect to WAPI,
  2. send a request,
  3. receive and process the response,
  4. receive and process notifications (for asynchronous requests).

The following text assumes JSON. For XML, adjust your code accordingly.

Connecting to WAPI

To connect, you need:

  • your WEDOS login email and WAPI password,
  • the WAPI URL for your format:
    • XML: https://api.wedos.com/wapi/xml
    • JSON: https://api.wedos.com/wapi/json

Every request contains the authorization string auth. It changes every hour and is calculated as follows:

  1. Calculate the SHA-1 hash of the WAPI password.
  2. Append it to your login email.
  3. Append the current hour as two digits (00–23, for example 09).
  4. Calculate the SHA-256 hash of the whole string (64 hexadecimal characters).

For backward compatibility, WAPI also accepts a string where the last step uses SHA-1 (40 characters). Use SHA-256 for new integrations.

The hour is taken in the Europe/Prague time zone (CET, UTC+1; during daylight saving time CEST, UTC+2). WAPI accepts the string for the current, previous and next hour, so a small clock difference around the turn of the hour does not matter.

Use the WAPI password to communicate with WAPI. The customer account password does not work.

The following PHP script connects to WAPI and sends a ping request. Replace the login email and WAPI password with your own. For other commands, change command and add the data part with the command parameters.

<?php
date_default_timezone_set('Europe/Prague');
$login = 'your@login.tld';
$wpass = 'your-WAPI-password';
$auth = hash('sha256', $login . sha1($wpass) . date('H', time()));
$url = 'https://api.wedos.com/wapi/json';
$input = [ 'request' => [
    'user' => $login,
    'auth' => $auth,
    'command' => 'ping',
    'clTRID' => 'my-first-ping',
    // 'data' => ['parameter' => 'value'], // command parameters, if any
    // 'test' => 1, // optional: only checks the request, makes no changes
  ]
];

$post = json_encode($input);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'request=' . urlencode($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
$res = curl_exec($ch);
curl_close($ch);
echo $res; // WAPI response in JSON
?>

WAPI Request

A request contains this data:

  • user = login email of your WEDOS customer account (required)
  • auth = authorization string (required), see Connecting to WAPI
  • command = command name (required)
  • clTRID = your request ID (optional). You can put any string here; WAPI returns it in the response.
  • data = command parameters (optional). The parameters of each command are described in the article for the service.
  • test = test mode (optional). With the value 1, WAPI only checks the request and makes no changes.

JSON request template:

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "command name",
    "clTRID": "your request id (optional)",
    "data": {
      "parameter name": "value"
    },
    "test": 1
  }
}

WAPI Response

A response contains this data:

  • code = return code, see Return Codes and the article for the service
  • result = description of the return code
  • timestamp = processing time as a UNIX timestamp (seconds since 1 January 1970)
  • clTRID = your request ID
  • svTRID = server-side request ID
  • command = command name
  • data = returned data. If the request fails or is a test request, data is usually not returned.
  • test = included only in responses to test requests

JSON response template:

{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "command name",
    "data": {
      "item name": "value"
    }
  }
}

Example response to a test domain-create request:

{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": 1286356644,
    "clTRID": "your request id",
    "svTRID": "1286356644.0246.21616",
    "command": "domain-create",
    "test": 1
  }
}

Paging and Searching Lists

List commands have optional search and paging parameters. If you do not use them, WAPI returns the whole list in the same form as before.

Parameters in the data part of the request:

  • search = text to search for, case-insensitive. For domains-list and wgp-services-list it searches the domain name, for dns-rows-list the record name or data.
  • page = page number starting from 1 (default 1)
  • page_limit = items per page, at most 1,000 (WAPI lowers a larger value to 1,000). If omitted or 0, WAPI returns all items.

The dns-rows-list command also has these filters:

  • row_name = exact record name; @ means a record directly on the domain
  • rdtype = record type (A, AAAA, MX, TXT…), case-insensitive

If you enter any of these parameters, WAPI returns the list as an array (in the domain item for domains-list, row for dns-rows-list, service for wgp-services-list) and adds to the data part of the response:

  • total = total number of items after filtering
  • page = number of the returned page
  • page_limit = items per page used (0 = all)

Things to keep in mind:

  • A page beyond the end of the list returns an empty list with total, not an error.
  • WAPI does not reject an invalid page or page_limit value (text, negative number); it replaces it with the default: page 1, page_limit 0 (all items).
  • An array instead of a value in page or page_limit returns error 2101.
  • The dns-domains-list command always returns total, page and page_limit. If page_limit is omitted or 0, it uses 1,000.
  • The wgp-domain-templates-list command has its own paging (per_page, page); see WAPI – WEDOS Protection (WGP).

domains-list request: active domains containing “example”, first page with two domains.

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "domains-list",
    "clTRID": "your request id",
    "data": {
      "status": "active",
      "search": "example",
      "page": 1,
      "page_limit": 2
    }
  }
}

dns-rows-list request: A records of the domain example.com, first page with 50 records.

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "dns-rows-list",
    "clTRID": "your request id",
    "data": {
      "domain": "example.com",
      "rdtype": "A",
      "page": 1,
      "page_limit": 50
    }
  }
}

Notifications

Asynchronous requests cannot be completed immediately; you track their progress and result through notifications. Synchronous requests do not use notifications.

If WAPI cannot complete an operation immediately, it returns 1001 (Request pending). When the operation is completed (for more complex actions also after individual steps), it creates a notification similar to a response. You match a notification to its request by clTRID or svTRID.

Notification data is always encoded in UTF-8.

Depending on your WAPI settings, you can receive notifications:

  • through the POLL queue, see the poll-req and poll-ack commands,
  • by email to the address you entered,
  • over HTTP or HTTPS to the URL you entered, using POST in the request parameter. An HTTP response with code 200 counts as successful delivery. If delivery fails, the system retries at intervals of several minutes.

JSON notification template:

{
  "notify": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "command name",
    "id": "POLL queue id",
    "data": {
      "item name": "value"
    }
  }
}

System Notifications

System notifications inform you about important events that were not triggered by your request. Currently, this is only the transfer of a domain to another registrar. If you have WAPI active, the system sends this information as a notification, just like for an asynchronous request.

The format of system notifications sent by email or to a URL is set by Preferred protocol in the WAPI settings. A notification downloaded from the POLL queue comes in the same format in which you sent the poll-req command.

The structure is the same as for a regular notification; command is always system-notify and the details are in the data part.

Request and Notification Log

You can find an overview of your WAPI requests in the WEDOS Global administration:

  1. Log in to the WEDOS Global administration ⧉.
  2. In the left panel, select WAPI.
  3. Select WAPI requests.

We keep the request log for 30 days.

Sent and unsent notifications are in the same section under WAPI notifications. For each notification, you can see its type, command, return code, state, creation and sending time and the number of delivery attempts.


Basic Requests

The basic requests are ping, ping-async and the POLL queue commands poll-req and poll-ack.

ping

The ping request tests WAPI: your login, IP address or code.

Return codes:

  • 1000 = OK

JSON request:

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "ping",
    "clTRID": "your request id"
  }
}

JSON response:

{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "ping"
  }
}

ping-async

The ping-async request tests WAPI notification delivery.

Return codes:

  • 1000 = OK
  • 1001 = request accepted, the result will arrive in a notification

JSON request:

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "ping-async",
    "clTRID": "your request id"
  }
}

JSON response:

{
  "response": {
    "code": 1001,
    "result": "Request pending",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "ping-async"
  }
}

JSON notification:

{
  "notify": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "ping-async",
    "id": "POLL queue id",
    "data": {
      "round": "attempt number",
      "time": "time",
      "done": 1
    }
  }
}

poll-req and poll-ack

You download notifications from the POLL queue with a combination of poll-req and poll-ack:

  • poll-req downloads the oldest unread notification,
  • poll-ack marks it as read and makes the next one available, until the queue is empty.

Notifications in the POLL queue are deleted automatically after 30 days.

poll-req return codes:

  • 1000 = notification downloaded
  • 1003 = there is no unread notification in the queue
  • 2150 = downloading notifications from the POLL queue is not allowed for this account

JSON poll-req request:

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "poll-req",
    "clTRID": "your request id"
  }
}

JSON poll-req response (notification available):

{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "poll-req",
    "data": {
      "notify": {
        "code": 1000,
        "result": "OK",
        "timestamp": "UNIX time",
        "clTRID": "your id of the original request",
        "svTRID": "server id of the original request",
        "command": "command name",
        "id": "POLL queue id"
      }
    }
  }
}

JSON poll-req response (queue empty):

{
  "response": {
    "code": 1003,
    "result": "Empty notifications queue",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "poll-req"
  }
}

poll-ack parameters:

  • id = notification ID in the POLL queue (required)

poll-ack return codes:

  • 1002 = notification marked as read
  • 2151 = notification not found

JSON poll-ack request:

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated auth string",
    "command": "poll-ack",
    "clTRID": "your request id",
    "data": {
      "id": "POLL notification id"
    }
  }
}

JSON poll-ack response:

{
  "response": {
    "code": 1002,
    "result": "Notification acquired",
    "timestamp": "UNIX time",
    "clTRID": "your request id",
    "svTRID": "server request id",
    "command": "poll-ack"
  }
}

Solving Common Problems

The most common WAPI problems are:

Request Authentication Failure

Problem: WAPI returns code 2050 (authentication failure) or 2051 (access from this IP address is not allowed).

Cause: the authorization string is wrong (wrong login, password or time), or your system connects from an IP address that is not allowed.

Solution: make sure that:

  • your system’s IP address is among the allowed IP addresses in the administration ⧉ (see Activating WAPI),
  • your script uses the WAPI password, not the customer account password,
  • your script takes the hour in the Europe/Prague time zone and the server clock is synchronized,
  • your script calculates auth exactly as described in Connecting to WAPI (SHA-1 of the password, then SHA-256 or SHA-1 of the whole string),
  • enough time has passed since you changed the WAPI settings (see Activating WAPI).

Every invalid request counts towards the invalid request limit. If WAPI returns code 2052, your IP address is temporarily blocked. Fix the cause first, then send a new request.

No Response to Requests

Problem: I do not get any responses to my requests.

Cause: the request did not reach WAPI or the connection failed. It is not an authentication error; in that case WAPI responds with code 2050 or 2051.

Solution: check WEDOS Status ⧉ for outages. Then make sure that:

  • your script sends the request to the correct WAPI URL over HTTPS using POST,
  • your server can open outgoing HTTPS connections.

If the problem persists, contact us through the contact form ⧉.


Frequently Asked Questions

Can I use all WAPI commands if I activated WAPI through WEDOS Global?

Yes. Regardless of which administration you activated WAPI in, you can use all commands in your system.

Do I have to switch from SHA-1 to SHA-256?

No, WAPI still accepts an authorization string calculated with SHA-1. We recommend SHA-256 for new integrations.

Was this article helpful?

Your feedback helps us improve our articles.

Your message goes to the documentation team, who do not reply to it. If you need help, contact us using the contact form. Do not include passwords or personal data.

Didn’t find what you were looking for?

Send us your question using the contact form.