WEDOS REST API is still in development. Access and features may change without notice.
This article partially covers the WEDOS.protection endpoint of WEDOS REST API. WEDOS.protection domains and services have their own articles. For WEDOS API (WAPI) see WAPI – WEDOS Protection.
For basic information anbout WEDOS REST API, consult the WEDOS REST API Manual.
In this article, you will find the following information:
- DNS Endpoint access
- DNS Endpoint details:
- Notes
WGP Endpoint Access
The WGP HTTP REST API v2 is used to manage domains, services and co-management invitations in WEDOS.protection (WGP).
Base URL and Authentication
The base URL for the WGP endpoints is: https://api.wedos.com/v2
Authentication uses only OAuth2: include a valid access token in the request header (Authorization: Bearer <TOKEN>) with the wgp scope. Without a valid token the API returns error 2000.
You can add the parameter example=1 to any endpoint as a GET parameter (?example=1 for endpoints without their own GET parameters, otherwise &example=1). The API then returns a sample curl command for that call without requiring real parameters. Valid authentication is required even in this mode.
Endpoint Overview
| Method | Endpoint | Description |
|---|---|---|
| POST | /members | Create a domain co-management invitation |
| GET | /members/{email} | Show a co-management invitation |
| DELETE | /members/{email} | Delete a co-management invitation |
Response format
The API response is always a JSON object with the keys code (return code), msg (text description), request_id (request identifier) and, where applicable, data (returned data on success).
General return codes valid for all endpoints (REST layer, independent of the specific operation):
1000– success (OK)2000– authentication (OAuth2 Bearer token) missing or invalid2004– maximum request size exceeded (URL or request body)4000– unknown/unsupported API method (the called combination of HTTP method and path does not exist)4001– input validation failed4005– no example available for the current endpoint inexample=1mode6000– internal error initializing the underlying WAPI command
In addition, each endpoint returns its own business codes specific to the operation (corresponding to the underlying WAPI command). These are listed under Return codes for each endpoint.
POST /members
Creates an invitation to co-manage one or more WGP domains for the given e-mail address.
Parameters:
email– required – e-mail address the invitation is created forpolicies– required, object – an associative array in the form{domain or "*" (all domains) => 0/1}, e.g.{"domain1.tld":1}or{"*":1}; it is not a plain array of domain names
Return codes:
1000– OK2223– invalid format or non-existent e-mail address2419– invitation not found2420– invalid array of domain rules/conditions (policies)2424– the membership already exists2400– internal error – unregistered return code
Response data:
email– invitation e-mail addressurl– URL for confirming the invitationpolicies_count– number of rules given
Example:
curl -X POST -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' \
'https://api.wedos.com/v2/wgp/members' \
--data '{"email":"esmeralda@wedos.com","policies":{"domain1.tld":1}}'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"email": "esmeralda@wedos.com",
"url": "https://wgp.wedos.com/invite/abc123def456",
"policies_count": 1
}
}
GET /members/{email}
Shows an existing domain co-management invitation for the given e-mail address.
Parameters:
email– required, path, URL-encoded (e.g.%40for@) – invitation e-mail address
Return codes:
1000– OK2223– invalid format or non-existent e-mail address2419– invitation not found2400– internal error – unregistered return code
Response data:
email– invitation e-mail addressurl– URL for confirming the invitationpolicies_count– number of rules given
Example:
curl -X GET -H 'Authorization: Bearer <TOKEN>' \
'https://api.wedos.com/v2/wgp/members/esmeralda%40wedos.com'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"email": "esmeralda@wedos.com",
"url": "https://wgp.wedos.com/invite/abc123def456",
"policies_count": 1
}
}
DELETE /members/{email}
Deletes an existing domain co-management invitation for the given e-mail address.
Parameters:
email– required, path, URL-encoded – invitation e-mail address
Return codes:
1000– OK2223– invalid format or non-existent e-mail address2419– invitation not found2400– internal error – unregistered return code
Response data:
email– e-mail address of the deleted invitation
Example:
curl -X DELETE -H 'Authorization: Bearer <TOKEN>' \
'https://api.wedos.com/v2/wgp/members/esmeralda%40wedos.com'
{
"code": 1000,
"msg": "OK",
"request_id": "a1b2c3d4",
"data": {
"email": "esmeralda%40wedos.com"
}
}
Notes
- Neither POST /members nor GET /members/{email} ever returns the content of the given policies in its response – only email, url and policies_count. This is the behaviour of the external WGP administration, not a limitation of this REST layer.
