In this article, you will learn:
- How WAPI works and what it is used for
- How to activate WAPI in the customer administration
- How communication and authentication work
- Basic commands
- List of return codes
- Glossary
WEDOS API
WEDOS API, or WAPI, is used to control services directly from your information system.
A condition for using the interface is the use of a WEDOS Credit Account, from which the system deducts payments for registrations, renewal, transfer and other charged fees.
WAPI currently allows the management of:
- Credit Account ⧉ (
account-*andcredit-*) - Domains ⧉ (
domains-*anddomain-*) - Domain contacts ⧉ (
contact-*) - NSSET ⧉ (
nsset-*) - DNS ⧉ (
dns-*) - Authorized users of WEDOS Global ⧉ (
wg-members-*) - WEDOS Protection ⧉ (
wgp-services-*andwgp-domain-*)
WAPI limitations
As protection against abuse, WAPI applies these limitations:
- You can send a maximum of 1000 requests per hour through one user account. This applies to all requests of all types; once this limit is reached, WAPI rejects further requests until the time limit expires.
- One user account may submit a maximum of 100 domain availability requests per hour. This applies to the domain-check, domain-create, and domain-transfer-check commands.
- Repeated sending of invalid requests (authentication failure, access from a disallowed IP address, incorrect input, missing or incorrect parameters, unknown command, commands ending with any error, or any request beyond other limits) will, after exceeding 10 invalid requests, result in the IP address being blocked for 1 minute for each invalid request. With each additional incorrect request, the system extends the blocking time.
Synchronous and asynchronous operations
Most commands executed through WAPI are synchronous – you send a command and usually get the result within a few seconds.
Some operations are asynchronous, meaning that processing such a command may take a very long time (even hours or days). WAPI therefore does not return the final result, but only information about acceptance of the command. Information about the progress and final result is then sent by the system in the form of notifications.
Logging
You can find the request log in the customer administration by following these steps:
- Sign in to the customer administration ⧉.
- In the top menu, select My account Customer.
- In the left menu, select WAPI requests.
Activating WAPI in the customer administration
Before you start using WAPI, activate it in the customer administration by following these steps:
- Sign in to the customer administration ⧉.
- In the top menu, select My account Customer.
- In the left menu, select WAPI interface.
- Set the allowed IP addresses (IPv4 or IPv6, CIDR supported), notification method, preferred protocol, and password.
- Confirm the settings with the Set button.

All settings entered during activation can later be changed in the same way. By clearing the contents of the Allowed IP addresses field, you deactivate WAPI.
Communication and authentication
Communication with the WAPI interface takes place over the HTTPS protocol. Data is passed by the POST method in the request parameter in XML or JSON format. The basic form of the command and response is the same for all commands. Data encoding is UTF-8.
Interface URLs:
- XML:
https://api.wedos.com/wapi/xml - JSON:
https://api.wedos.com/wapi/json
Request structure
A request consists of the following data:
- user: User name (e-mail) of your customer account, required parameter.
- auth: Authorization string, required parameter. This is a sha1 hash of a string composed of the user name, the sha1 hash of the WAPI password, and the current hour (00-23). The time zone is Europe/Prague (winter time UTC+1 CET, summer time UTC+2 CEST). See the code below for a specific example.
- command: The WAPI command itself. Required parameter.
- clTRID: Request ID, optional parameter. You can enter any string as an identifier in this element, which WAPI will return in the response.
- data: Data part of the command. Optional parameter.
- test: Test mode flag, optional parameter. If you include the test element with a value of 1 in the command, WAPI will only check your command and will not make any changes.
When communicating with WAPI, use the WAPI password. The customer account password does not work.
The request template (JSON) is therefore:
{
"request":
{
"user": "your@login.tld",
"auth": "authorization string",
"command": "request name",
"data":
{
request data
}
"clTRID": "request identifier (optional)",
"test": "1 (if you want to only test the request, optional)"
}
}
A complete example of use in PHP (data format JSON) can be:
<?php
date_default_timezone_set('Europe/Prague');
$login = 'your@login.tld';
$wpass = 'your WAPI password';
$auth = sha1($login.sha1($wpass).date('H', time()));
$url = 'https://api.wedos.com/wapi/json';
$input = [ 'request' => [
'user' => $login,
'auth' => $auth,
'command' => 'request name',
'data' => ['request data field'],
'clTRID' => 'request identifier (optional)',
'test' => '1 (if you want to only test the request)'
]
];
$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);
?>
Response structure
A response consists of the following data:
- code: Return value of the command. More information can be found in the Return codes chapter.
- result: Text description of the return code.
- timestamp: Time of command execution in UNIX format.
- clTRID: Client-side command identifier.
- svTRID: Server-side command identifier.
- command: WAPI command.
- data: Return values. If the command fails, no data is returned.
- test: Inserted in a response to commands that also include this flag.
A sample response in JSON format looks like this:
{
"response":
{
"code": "1000",
"result": "ok",
"timestamp": "1286356644",
"svTRID": "1286356644.0246.21616",
"command": "domain-create",
"data":
{
"num": "1311000863",
"expiration": "2011-10-06"
},
"test": "1"
}
}
Notifications
Asynchronous operations cannot be performed immediately. You can follow the progress and result of such operations through notifications. Synchronous requests do not use notifications.
If WAPI cannot complete an operation immediately, it returns Request pending (1001) in the response. After the operation is completed (or individual steps of more complex actions), it creates a notification, which is similar to a standard response. You can assign the notification to the corresponding request by the clTRID or svTRID parameters.
Notification data is always encoded in UTF-8.
You can obtain notifications in the following ways (depending on the settings made during activation):
- Via the POLL queue.
- By sending them to the specified e-mail address.
- Via the HTTP (or HTTPS) protocol to the URL you specify by the POST method in the request parameter. A correct delivery is considered to be an HTTP response with return code 200. If delivery fails, our system will attempt delivery again at several-minute intervals.
A sample notification in JSON format looks like this:
{
"notify": {
"code": 1000,
"result": "OK",
"timestamp": 1286957932,
"clTRID": "AvrX87Kqk6h3",
"svTRID": "1286957874.1271.15706",
"command": "ping-async",
"ID": 2691
}
}
System notifications
System notifications send information about relevant events, currently only about a domain transfer. If WAPI is active on your account, the system sends such information through a notification, just like with an asynchronous command.
Set the protocol through which WAPI sends system notifications according to the chapter Activating WAPI in the customer administration. This option works for notifications sent to e-mail or to a URL address. In the case of retrieval from the POLL queue, the response is in the same form as the command.
The structure is the same as for a standard notification, the command (command) is always system-notify. More detailed information can be found in the data node.
Basic commands
Basic commands include ping, ping-async, and the commands for working with the POLL queue poll-req and poll-ack.
ping
The ping command is used to test the functionality of WAPI – for example, login credentials, IP address, or code.
Return values are:
- 1000 – OK
JSON command:
{
"request": {
"user": "your@login.tld",
"auth": "generated authorization string",
"command": "ping",
"clTRID": "custom id code"
}
}
JSON response:
{
"response": {
"code": "1000",
"result": "OK",
"timestamp": "UTC time",
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "ping"
}
}
ping-async
The ping-async command tests the functionality of WAPI notifications.
Return values are:
- 1000 OK
- 1001 Waiting for command
JSON command:
{
"request": {
"user": "your@login.tld",
"auth": "generated authorization string",
"command": "ping",
"clTRID": "custom id code"
}
}
JSON response:
{
"response": {
"code": "1001",
"result": "Request pending",
"timestamp": "UTC time",
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "ping"
}
}
JSON notification:
{
"notify": {
"code": “1000”,
"result": "OK",
"timestamp": "UTC time",
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "ping-async",
"id": "ID for the POLL queue",
"data": {
"round": "attempt number",
"time": "time",
"done": 1
}
}
}
poll-req and poll-ack
You obtain notifications from the POLL queue by combining the poll-req and poll-ack commands:
- Use poll-req to download the oldest available notification.
- Use poll-ack to mark the notification as received, thereby making newer ones available until the queue is exhausted.
Return values for poll-req are:
- 1000 – notification received
- 1003 – there is no unread notification in the queue
- 2150 – your account does not have notification downloading from the poll queue set up
JSON command poll-req:
{
"request": {
"user": "your@login.tld",
"auth": "generated authorization string",
"command": "poll-req",
"clTRID": "custom id code"
}
}
JSON response to poll-req (notification available):
{
"response": {
"code": “1000”,
"result": "OK",
"timestamp": "UTC time",
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "poll-req",
"data": {
"notify": {
"code": “1000”,
"result": "OK",
"timestamp": "UTC time",
"clTRID": "custom id code of the found command",
"svTRID": "server id code for the found command",
"command": "command name",
"id": "ID in the POLL queue"
}
}
}
}
JSON response to poll-req (empty notification queue):
{
"response": {
"code": 1003,
"result": "Empty notifications queue",
"timestamp": “1286962852”,
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "poll-req"
}
}
For the poll-ack command, you enter data (parameters):
- id – ID of the current POLL notification
Return values for poll-ack are:
- 1002 – notification marked as received
- 2151 – notification not found
JSON command poll-ack:
{
"request": {
"user": "your@login.tld",
"auth": "generated authorization string",
"command": "poll-ack",
"clTRID": "custom id code",
"data": {
"id": “ID of the received POLL notification”
}
}
}
JSON response to poll-ack:
{
"response": {
"code": “1002”,
"result": "Notification acquired",
"timestamp": "UTC time",
"clTRID": "custom id code",
"svTRID": "server id code",
"command": "poll-ack"
}
}
List of return codes
The return codes in the responses and notifications help you identify the process and any WAPI errors.
Basic classification of return codes:
- 1xxx – the command was completed successfully.
- 2xxx – incorrect command (for example, missing input items or incorrect format/value).
- 3xxx – target object error – the requested action cannot be performed, the object is not in the correct state (for example, when trying to register a domain that is already taken, …).
- 4xxx – error while executing the command (e.g. unavailability of the domain registry, communication error, etc.).
- 5xxx – internal error or status of our system.
- x0xx, x1xx – general.
- x2xx – domains.
- x3xx – DNS.
You can always find the specific responses returned for a given command in the command documentation.
Glossary
- Asynchronous command: A command executed for a longer time; it returns only a message about acceptance, and you track further progress through notifications.
- API: Application Programming Interface. An interface that allows you to use your own code to obtain data or manage a third-party application.
- Data: The content of some commands specifying detailed settings. The data structure is determined by the specific command.
- JSON: JavaScript Object Notation. A modern way of communicating with an API.
- Return code: A number identifying the type of WAPI response to a command.
- Notification: JSON or XML code with messages about the progress of an asynchronous command.
- Command: A request to WAPI.
- Synchronous command: A command executed practically immediately. It returns a full response and does not use notifications.
- System notifications: A special type of notification about events in the system; WAPI sends them automatically in the configured format.
- UTF-8: Unicode Transformation Format. A widely used international character encoding standard supporting a large number of scripts.
- WAPI: An interface for managing some parts of the customer administration (Credit Account, domains, DNS).
- XML: eXtended Markup Language. An older way of communicating with an API.