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 – add a domain to WEDOS Global
- wgp-domain-info – list WG domain information
- wgp-domain-renew – renew service
- wgp-domain-delete – terminate service
- wgp-domain-update-subscription – change plan
- wgp-domain-retry – resolve some errors
- wgp-domain-cache-purge – purge WGP cache
- wgp-domain-template-replicate – replicates a template to an existing domain
- wgp-domain-templates-list – domain template list
- wgp-services-list – WEDOS Global domain list
wgp-domain-create
Use the wgp-domain-create request to create a domain record in WEDOS Global. This request is asynchronous and communicates via notifications.
Parameters
- domain = domain name (required)
- variant_id = service plan (required) – 1 = Start, 2 = Advanced, 3 = Expert (you can find the plans and their prices on the product site)
- period_id = service period (required) – 1 = monthly, 4 = yearly
- upstream_ips = array of IP target adresses (optional) – you can find more information about target IPs in the Global – DNS and Target IPs article
- template_domain_id = template domain ID (optional)
- mode = domain mode (optional)
- ns = uses WEDOS NS (default); the system will activate the domain only if it successfully checks that it uses WEDOS DNS.
- cname = enables you to use another provider’s DNS servers, or add subdomains via CNAME record; the mode for any 3rd or higher level domain is always cname.
You can find more information about adding a domain to WEDOS Global in the Global – Add Domain article.
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
- 2416 = Invalid domain mode
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
Notification Response Data
- WGP_ID = WGP domain record ID
- domain = domain name
- order_num = order number
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)", "mode": "domain mode (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
- domain = 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-info", "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", "modes": ["režim domény"], "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-renew
Use the wgp-domain-renew request to extend the domain in the WEDOS Global service for another period.
Parameters
- service_id = service ID (required)
Return Values
- 1000 = OK
- 2100 = Required parameter missing
- 2101 = Parameters mismatch
- 2152 = Service renewal blocked
- 2206 = Missing user_id
- 2279 = Credit account blocked
- 2281 = Inactive credit account
- 2282 = Invalid credit account currency
- 2283 = Invalid amount or insufficient credit
- 2284 = Credit account information error
- 2286 = Credit account – internal error
- 2293 = Unable to get the credit balance on the credit account
- 2406 = Domain/service not found
- 2409 = Service renewal failed
Response Data
- service_id = service ID
- name = Domain name
- date_from = Service validity date
- date_to = Service expiration date
- fakt_order_num = Order number for service renewal
- currency = Credit account currency
- price = Renewal price
- credit = Credit account balance after renewal
Templates
JSON wgp-domain-renew
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-renew", "clTRID": "your ID", "data": { "service_id": "service ID" } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-renew", "data": { "service_id":"service ID", "domain":"domain_name.tld", "date_from":"YYYY-MM-DD", "date_to":"YYYY-MM-DD", "fakt_order_num":"Order nr.", "currency":"Currency code", "price": Amount, "credit":"Credit account balance" } } }
wgp-domain-delete
Use the wgp-domain-delete command to delete a domain from the WEDOS Global service.
Parameters
- service_id = service ID (required)
- force = Force deletion regardless of A/AAAA domain records (optional if token exists to rewrite DNS records)
Return values
- 1000 = OK
- 2100 = Required parameter missing
- 2274 = Internal error – user_id parameter missing
- 2292 = Domain not found in this user account
- 2400 = Internal error
- 2410 = Service not found
- 2411 = Unavailable token to rewrite DNS
- 2412 = Failed API request to rewrite DNS
- 2413 = Request failed, WGP does not have permission to update DNS
- 2414 = WGP does not have a token and the user did not set the force flag in WAPI
Response Data
- domain = domain name
- domain_id = domain ID
- wedos_client_id = client ID
- service_id = service ID
- service_type = service type
- wdns_data = array of IP updates
JSON wgp-domain-delete
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-delete", "clTRID": "your ID", "data": { "service_id": "service ID", "force": true (forces delete without updating DNS) | false (restores original DNS if able) } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-delete", "data":{ "domain":"domain_name.tld", "domain_id": id, "wedos_client_id":"id", "service_id":id, "service_type":"hosting_wedos_protection", "wdns_data":{ "domain":"domain_name.tld", "rows_a":{ "rem":{ "removed A record ID":{ "name":"removed A record name", "ttl":"removed A record TTL", "rdtype":"A", "rdata":"removed A record IP" } }, "add":{ "added A record ID":{ "name":"added A record name", "ttl":"added A record TTL", "rdtype":"A", "rdata":"added A record IP" } }, "stay":[ "list of unchanged addresses" ] }, "rows_aaaa": "rem":{ "removed AAAA record ID":{ "name":"removed AAAA record name", "ttl":"removed AAAA record TTL", "rdtype":"AAAA", "rdata":"removed AAAA record IP" } }, "add":{ "added AAAA record ID":{ "name":"added AAAA record name", "ttl":"added AAAA record TTL", "rdtype":"AAAA", "rdata":"added AAAA record IP" } }, "stay":[ "list of unchanged addresses" ] } } } } }
wgp-domain-update-subscription
Use the wgp-domain-update-subscription request to change the plan or billing period of the WEDOS Global service.
Parameters
- service_id = service ID (required)
- variant_id = service plan (optional) – 1 = Start, 2 = Advanced, 3 = Expert
- period_id = billing period (optional) – 1 = monthly, 4 = annual
For the request to function correctly, enter at least one of the variant_id or period_id parameters.
Return Values
- 1000 = OK
- 2100 = Required parameter missing
- 2101 = Parameters mismatch
- 2203 = Invalid period_id
- 2273 = Invalid variant
- 2400 = Intenral WGP error
- 2406 = Domain/service not fund
- 2408 = Missing variant_id or period_id
Response Data
- domain = domain name
- domain_id = domain ID
- wedos_client_id = client ID
- service_id = service ID
- service_type = service type
- variant_id = service plan ID
- period_id = billing period ID
- dirty = update checkmark (0 = same as before, 1 = changed)
JSON wgp-domain-update-subscription
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-update-subscription", "clTRID": "your ID", "data": { "service_id": "service ID", "variant_id": "1 = Start, 2 = Advanced, 3 = Expert", "period_id": "1 = monthly billing, 4 = annual" } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-update-subscription", "data":{ "domain": "domain_name.tld", "domain_id": domain ID, "wedos_client_id": "customer ID", "service_id": service ID, "service_type": "service type ID", "variant_id": plan ID, "period_id": billing period ID, "dirty": 0|1 } } }
wgp-domain-retry
With the wgp-domain-retry command, you repeat the request to issue a certificate. You can use it to resolve the error_crt status returned by the wgp-domain-info command.
Parametry
- domain = domain name (required)
Return Values
- 1000 = OK
- 2100 = Required parameter missing
- 2292 = Domain not found in this user account
- 2400 = Internal error
- 4000 = Internal error
Response Data
- domain = Domain name
- domain_id = Domain ID in WGP
- wedos_client_id = Client ID
JSON wgp-domain-retry
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-retry", "clTRID": "your ID", "data": { "domain": "nazev_domeny.tld" } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-retry", "data":{ "domain": "domain_name.tld", "domain_id": domain ID, "wedos_client_id": "customer ID" } } }
wgp-domain-cache-purge
Use wgp-domain-cache-purge to 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-domain-template-replicate
Use the wgp-domain-template-replicate request to change the target domain settings according to the selected template domain.
Parameters
- service_id – service ID (required)
- template_domain_id – target template domain ID (required)
- service_type – service type (optional)
- values: hosting_domain, hosting_wedos_protection
Return values
- 1000 = OK
- 2100 = Required parameter missing
- 2101 = Parameters mismatch
- 2400 = Internal 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
- 2406 = Domain/service not found
- 2407 = Template domain not found
- 4000 = Internal error
Response Data
- domain = domain name
- domain_id = domain ID
- service_id = service ID
- service_type = service type
- template_domain_id = template domain ID
- replications_count = performed replications count
- replications_limit = maximum replication count
JSON wgp-domain-template-replicate
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-template-replicate", "clTRID": "your ID", "data": { "service_id": service ID, "template_domain_id": template domain ID, "service_type": "hosting_domain, or hosting_wedos_protection (optional)" } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-template-replicate", "data":{ "domain":"domain_namey.tld", "domain_id": domain ID, "service_id": service ID, "service_type": "service type", "template_domain_id": template domain ID, "replications_count": replication count, "replications_limit": replication limit } } }
wgp-domain-templates-list
Use the wgp-domain-templates-list request to retrieve a list of template domains for the selected plan.
Parameters
- variant_id = plan ID (required)
- per_page = Number of records per page (default = 15, get all records = -1) (optional)
- page = Page number (default = 1) (optional)
- locale = Language (default = en, supported = cs, en) (optional)
- search = Search by columns custom_name, name (optional)
Return Values
- 1000 = OK
- 2100 = Required parameter missing
- 2400 = internal error
- 4000 = internal error
Response Data
- data = Template domain list
- id = template domain ID
- custom_name = Template domain name (as set by user)
- name = Template domain name (system)
- url = Template domain URL
- first_page_url = URL of the first list page
- from = Pagination start
- last_page = Number of last page
- last_page_url = URL of last list page
- links = Pagination link arrary
- url = link URL
- label = Button label
- active = null|1
- next_page_url = URL of next page
- path = Template domain list URL
- per_page = Number of entries per page
- prev_page_url = Previous page URL
- to = Pagination end
- total = Total page count
JSON wgp-domain-templates-list
JSON request
{ "request": { "user": "your@login.tld", "auth": "authentication string", "command": "wgp-domain-templates-list", "clTRID": "your ID", "data": { "variant_id": plan ID 1 = Start, 2 = Advanced, 3 = Expert, "per_page": entries per page (optional), "page": page nr. (optional), "locale": "cs, or en (optional)", "search": "Search by custom_name, name (optional)" } } }JSON response (OK)
{ "response": { "code": 1000, "result": "OK", "timestamp": "UTF timestamp", "clTRID": "your ID", "svTRID": "server ID", "command": "wgp-domain-templates-list", "data":{ [ { "id": Template domain ID, "custom_name":"termplate domain user name", "name":"system-name.template", "url":"https:\/\/template.domain.url\/system-name.template" } ], "first_page_url":"https:\/\/first.page.url", "from": 1st page number, "last_page": last page number, "last_page_url":"https:\/\/last.page.url", "links":[ { "url": "https:\/\/page.url", "label":"Button label", "active": null|1 } ], "next_page_url": "https:\/\/next.page.url", "path":"https:\/\/list.url", "per_page": entries per page, "prev_page_url":"https:\/\/previous.page.url", "to": last list item, "total": total page count } } }
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" } } }