### Get Products API Example
Source: https://domains.opensrs.guide/docs/get_products
This example demonstrates how to request a list of products using the get_products action.
```APIDOC
## POST /api/v1/domains
### Description
Retrieves a list of available domain products based on specified criteria.
### Method
POST
### Endpoint
/api/v1/domains
### Parameters
#### Request Body
- **protocol** (string) - Required - The protocol version, e.g., "XCP".
- **action** (string) - Required - The action to perform, e.g., "get_products".
- **object** (string) - Required - The object to interact with, e.g., "trust_service".
- **attributes** (object) - Optional - A nested object containing attributes to filter the products.
- **min_expiry_date** (string) - Optional - Minimum expiry date for filtering.
- **state** (string) - Optional - State of the product for filtering (e.g., "expired").
- **max_expiry_date** (string) - Optional - Maximum expiry date for filtering.
### Request Example
```xml
- XCP
- get_products
- trust_service
-
- 2012-04-23
- expired
- 2012-09-22
```
### Response
#### Success Response (200)
- **protocol** (string) - The protocol used.
- **action** (string) - The action performed, typically "REPLY".
- **object** (string) - The object type, typically "TRUST_SERVICE".
- **response_text** (string) - A message indicating the command status.
- **response_code** (integer) - The HTTP status code.
- **attributes** (object) - Contains the list of products.
- **product_list** (array) - A list of product objects.
- **expiry_date** (string) - The expiry date of the product.
- **state** (string) - The current state of the product.
- **product_type** (string) - The type of the product.
- **issue_date** (string) - The date the product was issued.
- **domain** (string) - The domain associated with the product.
- **product_id** (string) - The unique identifier for the product.
- **contact_email** (string) - The contact email for the product.
- **is_renewable** (string) - Indicates if the product is renewable ('0' or '1').
- **start_date** (string) - The start date of the product.
- **is_success** (integer) - Indicates if the operation was successful (1 for success, 0 for failure).
#### Response Example
```xml
- XCP
- REPLY
- TRUST_SERVICE
- Command completed successfully.
- 200
-
-
-
- 2012-04-23T10:41:04.000-04:00
- expired
- quickssl
- 2012-04-16T09:17:46.000-04:00
- example.org
- 2094
- qafive@example.com
- 0
- 2012-04-14T20:14:48.000-04:00
-
- 2012-05-08T07:34:49.000-04:00
- expired
- securesite_pro
- 2012-04-30T11:27:59.000-04:00
- example.net
- 2096
- qafive@example.com
- 0
- 2012-04-28T19:42:30.000-04:00
- 1
```
```
--------------------------------
### Domain Registration Examples
Source: https://domains.opensrs.guide/docs/sw_register-domain
Examples for registering common domain extensions.
```APIDOC
## Domain Registration Examples
### For domain = .COM, .NET, .ORG, .INFO, .BIZ, .NAME, .ME, and .MOBI
[Further examples would be detailed here if provided in the source text.]
```
--------------------------------
### Activate Domain Response Example
Source: https://domains.opensrs.guide/docs/activate-domain
This is an example of a response when attempting to activate a .DE domain. A success value of '0' indicates failure.
```xml
- XCP
- REPLY
- DOMAIN
- 0
- 437
- A request is currently waiting on
this domain
```
--------------------------------
### Domain Suggestion API - Example 4
Source: https://domains.opensrs.guide/docs/name_suggest
This example demonstrates how to request domain suggestions, premium domain information, and perform lookups for .COM domains, limiting the suggestions to a maximum of 10.
```APIDOC
## POST /api/domains/suggest
### Description
This endpoint allows you to search for domain name suggestions, check for premium domains, and perform domain lookups. It supports specifying TLDs and a maximum number of suggestions.
### Method
POST
### Endpoint
/api/domains/suggest
### Parameters
#### Request Body
- **protocol** (string) - Required - The communication protocol (e.g., XCP).
- **action** (string) - Required - The action to perform (e.g., name_suggest).
- **object** (string) - Required - The object type (e.g., domain).
- **attributes** (object) - Required - Contains various attributes for the request.
- **service_override** (object) - Optional - Overrides default service behavior.
- **premium** (object) - Optional - Configuration for premium domain checks.
- **tlds** (array) - Required - List of TLDs to check (e.g., [".com"])
- **suggestion** (object) - Optional - Configuration for domain suggestions.
- **tlds** (array) - Required - List of TLDs for suggestions (e.g., [".com"])
- **maximum** (integer) - Optional - Maximum number of suggestions to return (e.g., 10).
- **lookup** (object) - Optional - Configuration for domain lookups.
- **tlds** (array) - Required - List of TLDs to lookup (e.g., [".com"])
- **services** (array) - Required - List of services to enable (e.g., ["lookup", "suggestion", "premium"])
- **searchstring** (string) - Required - The string to search for (e.g., "abc&d")
### Request Example
```xml
- XCP
- name_suggest
- domain
-
-
-
-
- .com
-
-
- .com
- 10
-
-
- .com
-
- lookup
- suggestion
- premium
- abc&d
```
### Response
#### Success Response (200)
- **protocol** (string) - The communication protocol.
- **action** (string) - The action performed (e.g., REPLY).
- **response_text** (string) - Textual description of the response.
- **is_success** (integer) - Indicates if the command was successful (1 for success, 0 for failure).
- **response_code** (integer) - The response code.
- **attributes** (object) - Contains the results of the requested services.
- **lookup** (object) - Results for the lookup service.
- **count** (integer) - Number of items found.
- **response_text** (string) - Response text for lookup.
- **response_code** (integer) - Response code for lookup.
- **is_success** (integer) - Success status for lookup.
- **items** (array) - List of lookup items.
- **domain** (string) - The domain name.
- **status** (string) - The status of the domain (e.g., available, taken).
- **premium** (object) - Results for the premium domain service.
- **count** (integer) - Number of premium items found.
- **response_text** (string) - Response text for premium.
- **response_code** (integer) - Response code for premium.
#### Response Example
```xml
- XCP
- REPLY
- Command completed successfully
- 1
- 200
-
-
- 2
- 0
- 1
-
-
- abc-d.com
- available
-
- abcd.com
- taken
-
- 3
- 0
```
```
--------------------------------
### Get UserInfo Response Example
Source: https://domains.opensrs.guide/docs/get-userinfo
This XML snippet shows a successful response to a user info request, detailing domain attributes and various capabilities such as email forwarding, domain authentication info, DNSSEC support, UK WHOIS opt-out eligibility, and IP tag changing.
```xml
- XCP
- REPLY
- USERINFO
- 1
- 200
- Command Successful
-
- 8
- example.org.uk
- 2007-11-25 00:00:00
- 131
- 1
- aaaa
-
- 0
- 0
- 1
- 1
- 1
```
--------------------------------
### Get Domain TLD Data (.ASIA)
Source: https://domains.opensrs.guide/docs/get-domain
This example demonstrates how to retrieve TLD-specific data for a .ASIA domain.
```APIDOC
## GET /api/domains
### Description
Retrieves Top-Level Domain (TLD) specific data for a given domain.
### Method
GET
### Endpoint
/api/domains
### Parameters
#### Query Parameters
- **domain** (string) - Required - The domain name to query (e.g., yourdomain.asia).
- **attributes.type** (string) - Required - Specifies the type of data to retrieve, set to 'tld_data'.
### Request Example
```xml
- XCP
- get
- domain
- yourdomain.asia
-
- tld_data
```
### Response
#### Success Response (200)
- **attributes.tld_data.ced_info** (object) - Contains detailed information for .ASIA domains, including legal entity type, location, and ID details.
#### Response Example
```xml
- XCP
- REPLY
- DOMAIN
- Query Successful
- 200
- 1
-
-
-
- proprietorship
- NSW
- other
- tech
- Sydney
- AU
- driver's license
- other
- AB1234567
```
```
--------------------------------
### Registry Add NS Response Example (all = 0)
Source: https://domains.opensrs.guide/docs/registry_add_ns
This XML response confirms command verification when adding a nameserver with the 'all' parameter set to '0'. It indicates a general success without specific registry feedback.
```xml
- XCP
- reply
- nameserver
- Command verified
- 1
- 200
```
--------------------------------
### Get Domain TLD Data (.COOP)
Source: https://domains.opensrs.guide/docs/get-domain
This example shows how to retrieve TLD-specific data for a .COOP domain, including registrant extra information.
```APIDOC
## GET /api/domains
### Description
Retrieves Top-Level Domain (TLD) specific data for a given domain.
### Method
GET
### Endpoint
/api/domains
### Parameters
#### Query Parameters
- **domain** (string) - Required - The domain name to query (e.g., yourdomain.coop).
- **attributes.type** (string) - Required - Specifies the type of data to retrieve, set to 'tld_data'.
### Request Example
```xml
- XCP
- get
- domain
- yourdomain.coop
-
- tld_data
```
### Response
#### Success Response (200)
- **attributes.tld_data.registrant_extra_info** (object) - Contains extra information for .COOP domains, such as the verification code.
#### Response Example
```xml
- XCP
- REPLY
- DOMAIN
- 200
- 1
- Query Successful
-
-
-
- 123456789
```
```
--------------------------------
### Get UserInfo Request Example
Source: https://domains.opensrs.guide/docs/get-userinfo
This XML snippet demonstrates a request to retrieve user information, including domain details and capabilities, from the OpenSRS API.
```xml
- XCP
- GET
- USERINFO
- yourdomain.com
```
--------------------------------
### GET /api/domains/contact
Source: https://domains.opensrs.guide/docs/get-domain
This example demonstrates how to retrieve the administrative contact details for a specific domain using the OpenSRS API. It shows the XML structure for the request and the corresponding response.
```APIDOC
## GET /api/domains/contact
### Description
Retrieves the administrative contact details for a specified domain.
### Method
GET
### Endpoint
/api/domains/contact
### Parameters
#### Query Parameters
- **domain** (string) - Required - The domain name to query.
- **attributes** (string) - Optional - Specifies which attributes to retrieve. Example: "type".
### Request Example
```xml
- XCP
- GET
- DOMAIN
- yourdomain.com
-
- admin
```
### Response
#### Success Response (200)
- **contact_set** (object) - Contains the contact details.
- **admin** (object) - Administrative contact information.
- **first_name** (string) - The first name of the contact.
- **last_name** (string) - The last name of the contact.
- **email** (string) - The email address of the contact.
- **phone** (string) - The phone number of the contact.
- **city** (string) - The city of the contact's address.
- **state** (string) - The state or province of the contact's address.
- **postal_code** (string) - The postal code of the contact's address.
- **country** (string) - The country of the contact's address.
- **org_name** (string) - The organization name if applicable.
- **status** (string) - The status of the contact (e.g., 'active').
#### Response Example
```xml
- XCP
- DOMAIN
- Query Successful
- REPLY
-
-
-
- 32 Oak Street
- active
- Toronto
- ON
- M1M1M1
- CA
- Example Company
- Marlin
- Wilk
- EN
- test@example.com
- +1.4165551212
- 200
- 1
```
```
--------------------------------
### Lookup for New TLDs
Source: https://domains.opensrs.guide/docs/name_suggest
This example demonstrates how to look up a domain name for one of the new TLDs, such as .guru.
```APIDOC
## POST /api/domains/lookup
### Description
Performs a lookup for a domain name, checking its availability and other details for specified TLDs.
### Method
POST
### Endpoint
/api/domains/lookup
### Request Body
- **action** (string) - Required - The action to perform, should be 'name_suggest'.
- **object** (string) - Required - The object type, should be 'domain'.
- **protocol** (string) - Required - The protocol version, should be 'XCP'.
- **attributes** (object) - Required - Contains domain search attributes.
- **searchstring** (string) - Required - The domain name to search for.
- **tlds** (array of strings) - Required - A list of Top-Level Domains to search within.
- **services** (array of strings) - Optional - A list of services to include, e.g., 'lookup'.
### Request Example
```xml
- name_suggest
- domain
- XCP
-
-
- lookup
- example
-
- guru
```
### Response
#### Success Response (200)
- **protocol** (string) - The protocol used.
- **action** (string) - The action performed, typically 'REPLY'.
- **response_code** (integer) - The HTTP status code of the response.
- **is_success** (integer) - Indicates if the command was successful (1 for success, 0 for failure).
- **response_text** (string) - Textual description of the response.
- **attributes** (object) - Contains the lookup results.
- **lookup** (object) - Details of the domain lookup.
- **count** (integer) - The number of results found.
- **items** (array of objects) - A list of domain items found.
- **domain** (string) - The full domain name.
- **status** (string) - The availability status of the domain (e.g., 'available').
- **has_claim** (integer) - Indicates if the domain has a claim (1 for yes, 0 for no).
#### Response Example
```xml
- XCP
- REPLY
- 200
- 1
- 0.065
- Command completed
successfully
- 1
-
-
- 1
- Command completed
successfully.
- 1
- 200
-
-
- example.guru
- available
- 1
```
```
--------------------------------
### Register a premium domain via XCP
Source: https://domains.opensrs.guide/docs/sw_register-domain-or-trust_service-
Use this XML structure to initiate a premium domain registration. Ensure the premium_price_to_verify matches the registry's current pricing.
```xml
- XCP
- domain
- sw_register
-
- 1
- new
- testing1234
- testing1234testing
- 0
- example.bike
- 36.30
-
-
- Ciudad Real
- qafive@tucows.com
- Calle de la Azucena
- +1.4165350124
- Ciudad Real
- 13002
- mnhRJTHy
- ES
- QA Tester
- TTzfwelA
- Tucows
- +1.4165350124
-
- QA Tester
- ES
- Rob
- Tucows
- +1.4165350124
- McAuley
- qafive@tucows.com
- Calle de la Azucena
- Ciudad Real
- +1.4165350124
- Ciudad Real
- 13002
-
- Ciudad Real
- 13002
- Calle de la Azucena
- Ciudad Real
- qafive@tucows.com
- +1.4165350124
- McAuley
- Tucows
- +1.4165350124
- QA Tester
- ES
- Rob
-
- Calle de la Azucena
- qafive@tucows.com
- Ciudad Real
```
--------------------------------
### Registry Add NS Response Example (all = 1)
Source: https://domains.opensrs.guide/docs/registry_add_ns
This XML response indicates the outcome of adding a nameserver when the 'all' parameter is set to '1'. It details success or failure messages from various registries.
```xml
- XCP
- reply
- nameserver
-
- Successfully added
- Couldn't add nameserver: Unexpected response
from registry: 705: No RAs to service your domain.
- Couldn't add nameserver: Registry doesn't support nameserver as a separate object.
- Successfully added
- Couldn't add nameserver: Registry doesn't support nameserver as a separate object.
- Successfully added
- Successfully added
- Couldn't add nameserver: Registry doesn't support nameserver as a separate object.
- Successfully added
- Successfully added
- Successfully added
- Command verified
- 1
- 200
```
--------------------------------
### Delete (surname) Request and Response Examples
Source: https://domains.opensrs.guide/docs/delete-surname
Examples of the XML request to delete a domain and the corresponding successful or failed response messages.
```xml
- XCP
- DELETE
- SURNAME
-
- steven.smith.net
```
```xml
- XCP
- SURNAME
- In progress. Request successfully submitted and placed in the queue
- DELETE:REPLY
- 250
- 1
```
```xml
- XCP
- SURNAME
- Domain not found or in unacceptable state for this action
- DELETE:REPLY
- 424
- 0
```
--------------------------------
### Register a New Domain via XCP
Source: https://domains.opensrs.guide/docs/sw_register-domain-or-trust_service-
Use the SW_REGISTER action to initiate a new domain registration. This request includes owner, admin, and billing contact details.
```xml
- XCP
- DOMAIN
- SW_REGISTER
-
- 0
- example.com
- new
- user123
- changeit123
- 0
- *blank*
- 1
- 1
- process
-
-
- US
- Owner
- Example Inc.
- +1.4165550123
- Ottway
- Suite 500
- CA
- ottway@example.com
- SomeCity
- 90210
- +1.4165550124
- 32 Oak Street
- Owen
-
- US
- Admin
- Example Inc.
- +1.4165550123
- Adams
- Suite 100
- CA
- adams@example.com
- Santa Clara
- 90210
- +1.4165550125
- 32 Oak Street
- Adler
-
- US
- Billing
- Example Inc.
- +1.4165550123
- Burton
- Suite 200
- CA
- burton@example.com
- Santa Clara
- 90210
- +1.4165550136
- 32 Oak Street
- Bill
```