WAPI – WEDOS Global

  WAPI (API Interface)

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)

Return Values

  • 1000 = OK
  • 1001 = Request pending
  • 2101 = Parameters mismatch
  • 2202 = Invalid or unsupported domain name format
  • 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
  • 228? = Credit account errors
  • 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
  • 2295 = Unable to create domain to WGP. The payment has been cancelled.

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": {
      "name": "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)"]
    }
  }
}
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": {
      "name": "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-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",
        "name":"domain_name.tld",
        "status":"service status",
        "expiration": "expiration date YYYY-MM-DD"}
    }
  }
}

Děkujeme za zpětnou vazbu!