WAPI – WEDOS Global

  WAPI (API Interface)

This article deals with WAPI requests for WEDOS Global. If you are looking for instructions for managing Global services in the administration panel or WordPress plugin, search in the WEDOS Global category.

If you haven’t used WAPI before, read the WAPI Manual first.

This article provides information on the following requests:

wgp-domain-create

Use the wgp-domain-create request to create a domain record in WEDOS Global.

Parameters

  • name = domain name (required)
  • variant_id = service plan (required) – 1 = Start, 2 = Advanced, 3 = Expert
  • period_id = service period (required) – 1 = monthly, 4 = yearly
  • upstream_ips = array of IP adresses, which WG won’t resolve (optioinal)
  • template_domain_id = template domain ID (optional)

Return Values

  • 1000 = OK
  • 1001 = Request pending
  • 2101 = Parameters mismatch
  • 2202 = Invalid or unsupported domain name format
  • 2203 = Invalid period_id
  • 2206 = Invalid request – internal error
  • 2272 = Invalid format of ip address
  • 2273 = Invalid variant
  • 2274 = Internal error – user_id parameter missing
  • 2275 = Internal error – user not found
  • 2276 = Unsupported TLD or maximal domain level exceeded
  • 2277 = Not allowed to explicit prepend www. before the domain name
  • 2278 = Domain name cannot be used – there is service with this domain name
  • 2279 = Credit account is locked
  • 2280 = Credit account active
  • 2281 = Inactive credit account
  • 2282 = Invalid credit account currency
  • 2283 = Invalid amount or insufficient credit
  • 2284 = Credit account information error
  • 2285 = Incorrect VAT settings
  • 2286 = Credit account – internal error
  • 2290 = Credit account – activity has not been added to the credit account
  • 2291 = Domain already exists for this customer account in the WGP API
  • 2293 = Unable to get the credit balance on the credit account
  • 2294 = Unable to retireve service price
  • 2295 = Unable to create domain to WGP. The payment has been cancelled.
  • 2296 = Credit account movement cannot be cancelled
  • 2400 = Intenral WGP error
  • 2401 = Cannot apply template to domain
  • 2402 = Invalid domain template
  • 2403 = Domain template and user mismatch
  • 2404 = Domain template and domain plan mismatch
  • 2405 = Daily template domain reached

Response Data

  • WGP_ID = WGP domain record ID
  • domain = domain name
  • order_num = order number
  • currency = credit account currency
  • amount = service price
  • acc_amount_before = credit account balance before service activation
  • acc_amount_current = credit account balance after service activation

Templates

JSON wgp-domain-create

JSON request

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated authentication string",
    "command": "wgp-domain-create",
    "clTRID": "own ID code",
    "data": {
      "domain": "domain_name.tld",
      "variant_id": "1 = Start, 2 = Advanced, 3 = Expert",
      "period_id": "1 = monthly billing, 4 = yearly billing",
      "upstream_ips": ["IP address 1", "IP address 2", "(optional)"],
      "template_domain_id": "ID of the template domain (optional)"
    }
  }
}
JSON response (request pending)
{
  "response": {
    "code": 1001,
    "result": "Request pending",
    "timestamp": "UTF time",
    "clTRID": "own ID code",
    "svTRID": "server ID code",
    "command": "wgp-domain-create",
    "data": {
      "WGP_ID": "assigned domain ID in WG",
      "domain": "domain_name.tld",
      "order_num": "order number",
      "currency": "currency code",
      "amount": "price",
      "acc_amount_before": "credit account balance before transaction",
      "acc_amount_current": "credit account balance after transaction"
    }
  } 
}
JSON notification after setup is complete
{
  "notify": {
    "code": "1000",
    "result": "OK",
    "timestamp": "UTF time",
    "clTRID": "own ID code",
    "svTRID": "server ID code",
    "command": "wgp-domain-create",
    "id": "POLL queue ID",
    "data": {
      "WGP_ID": "assigned domain ID in WG",
      "domain": "domain_name.tld",
      "order_num": "order number",
    }
  }
}

wgp-domain-info

Use the wgp-domain-info request to display domain status information in the WEDOS Global service.

Parameters

  • name = domain name (required)

Return Values

  • 1000 = OK
  • 2100 = Required parameter missing
  • 2101 = Parameters mismatch
  • 2202 = Invalid or unsupported domain name format
  • 2206 = Invalid request – internal error
  • 2292 = Domain not found for this customer account in the WGP API

Response Data

  • wgp = domain status in WG; the state parameter has one of the following values:
    • pending_dns = domain DNS record resolution in progress
    • processing = waiting for service setup
    • stuck = waiting for software requirements
    • pending_txt = waiting for TXT record verification
    • pending_ns = waiting for nameserver setup
    • pending_dns_refresh = repeated DNS resolution, if previous pending_dns didn’t find any DNS records
    • pending_crt = waiting for Let’s Encrypt certificate for WG
    • active = domain active
  • service = domain status in WEDOS customer administration

You can find more detailed information on return data in the template.

Templates

JSON wgp-domain-info

JSON request

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated authentication string",
    "command": "wgp-domain-create",
    "clTRID": "own ID code",
    "data": {
      "dom ain": "domain_name.tld",
    }
  }
}
JSON response (OK)
{
  "response": {
    "code": 1000,
    "result": "ok",
    "timestamp": "UTF time",
    "clTRID": "own ID code",
    "svTRID": "server ID code",
    "command": "wgp-domain-info",
    "data": {
    "wgp":{
        "domain": "domain_name.tld",
        "domain_id": "assigned domain ID",
        "domain_tld": "tld",
        "settings": {
          "cache": "cache status (empty off, 1 on)"
        },
        "url": "https:\/\/client.wedos.global\/protection\/domains\/domain_name.tld",
        "state": "service status",
        "state_data": {
          "dns_ip_addresses": ["WG proxy IPv4 address", "WG proxy IPv6 address"],
          "dns_pointing_to_proxy": "DNS proxy routing check, empty false, 1 true",
          "dns_records_new": [
            {
              "name": "",
              "data": "WG proxy IPv4 address",
              "type": "A",
              "ttl": 300
            },
            {
              "name": "*",
              "data": "WG proxy IPv4 address",
              "type": "A",
              "ttl": 300
            },
            {
              "name": "",
              "data": "WG proxy IPv6 address",
              "type": "AAAA",
              "ttl": 300
            },
            {
              "name": "*",
              "data": "WG proxy IPv6 address",
              "type": "AAAA",
              "ttl": 300
            }
          ],
          "dns_records": [
            {
              "name": "",
              "data": "current IPv4 address",
              "type": "A",
              "ttl": 300
            },
            {
              "name": "*",
              "data": "current IPv4 address",
              "type": "A",
              "ttl": 300
            },
            {
              "name": "",
              "data": "current IPv6 address",
              "type": "AAAA",
              "ttl": 300
            },
            {
              "name": "",
              "data": "current IPv6 address",
              "type": "AAAA",
              "ttl": 300
            }
          ]
        }
      },
      "service": {
        "ID": "service ID in the system",
        "name": "domain_name.tld",
        "num": "order number",
        "user_id": "user ID in the system",
        "lang": "language code",
        "currency": "currency code",
        "cli_legal_type": "Billing - 1 = natural person, 2 = enterpreneur, 3 = legal person",
        "cli_company" :"Billing – Company name",
        "cli_fname": "Billing – Name",
        "cli_lname": "Billing – Surname",
        "cli_email": "Billing – Email",
        "cli_email2": "Billing – Backup email",
        "cli_phone": "Billing – Phone",
        "cli_mobile": "Billing – Mobile",
        "cli_fax": "Billing – Fax",
        "cli_ic": "Billing – Company ID",
        "cli_dic": "Billing – VAT ID",
        "cli_taxpayer": "Billing – VAT payer (0/1)",
        "cli_addr_street": "Billing – Street and number",
        "cli_addr_city": "Billing – Town",
        "cli_addr_zip": "Billing – ZIP",
        "cli_addr_country": "Billing – Country code",
        "cli_name_vies": "Billing – VIES name",
        "own_legal_type": "Operator - 1 = natural person, 2 = enterpreneur, 3 = legal person",
        "own_company": "Operator – Název firmy",
        "own_fname": "Operator - Name",
        "own_lname": "Operator - Surname",
        "own_email": "Operator - Email",
        "own_phone": "Operator - Phone",
        "own_ic": "Operator - Company ID",
        "own_dic": "Operator - VAT ID",
        "own_addr_street": "Operator – Street and number",
        "own_addr_city": "Operator - Town",
        "own_addr_zip": "Operator - ZIP",
        "own_addr_country": "Operator – Country code",
        "status": "service status in WEDOS customer administration",
        "expiration": "expiration date YYYY-MM-DD"
      }
    }
  }
}

wgp-domain-cache-purge

With the wgp-domain-cache-purge, you can purge the WEDOS Global Protection domain cache.

Parameters

  • service_id = Service ID (required)
  • service_type = Service type (optional)
    • values: hosting_wedos_protection (default), hosting_domain
  • limiter_decay = Blocking time in seconds (optional)
    • default value 5
  • limiter_reset = Cancel limiter (optional)
    • 0 (no, default), 1 (yes)

Return Values

  • 1000 = OK
  • 2100 = Required parameter missing
  • 2101 = Parameters mismatch
  • 2274 = internal error – missing user_id
  • 2400 = internal error – unknown return code
  • 2406 = domain/service not found
  • 2415 = limiter value reached
  • 4000 = system error

Response Data

  • domain = Domain name
  • domain_id = Domain ID
  • domain_tld = Domain TLD
  • service_id = Service ID
  • wedos_client_id = Client ID
  • limiter_available_in = Time in seconds until the function is available again

JSON wgp-domain-cache-purge

JSON request

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated authentication string",
    "command": "wgp-domain-cache-purge",
    "clTRID": "own ID code",
    "data": {
      "service_id": Service ID,
      "service_type": "service type code (optional)",
      "limiter_decay": limiter timeout (in seconds, optional),
      "limiter_reset": 0|1 (optional)
    }
  }
}
JSON response (OK)
{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UTF time",
    "clTRID": "own ID code",
    "svTRID": "server ID code",
    "command": "wgp-domain-cache-purge",
    "data":{
      "domain":"domain_name.tld",
      "domain_id": domain ID,
      "domain_tld":"tld",
      "wedos_client_id":"customer account ID"
    }
  }
}

wgp-services-list

With the wgp-services-list request, you can retrieve a list of domains with the WEDOS Global service. You can filter by status.

Parameters

  • status = service status (optional)

Return Values

  • 1000 = OK
  • 2206 = Invalid request – internal error

Response Data

  • ID = domain record ID
  • name = domain name
  • status = domain status
  • expiration = WG service expiration date

Templates

JSON wgp-services-list

JSON request

{
  "request": {
    "user": "your@login.tld",
    "auth": "generated authentication string",
    "command": "wgp-domain-create",
    "clTRID": "own ID code",
    "data": {
      "status": "pending_dns, processing, stuck, pending_txt, pending_ns, pending_dns_refresh, pending_crt, or active"
    }
  }
}
JSON response (OK)
{
  "response": {
    "code": 1000,
    "result": "OK",
    "timestamp": "UTF time",
    "clTRID": "own ID code",
    "svTRID": "server ID code",
    "command":"wgp-services-list",
    "data":{
      "service ID in the system":{
        "ID":"service ID in the system",
        "domain":"domain_name.tld",
        "status":"service status",
        "expiration": "expiration date YYYY-MM-DD"
    }
  }
}

Děkujeme za zpětnou vazbu!