-
Notifications
You must be signed in to change notification settings - Fork 3
Tool module
Miky edited this page Sep 10, 2015
·
2 revisions
The Tool module provides general utilities.
All the methods from this module are prefixed with tool_. For example:
$dondominio = new DonDominioAPI(array(
'apiuser' => '00000-XXX',
'apipasswd' => 'XXXXXXXXXXXX'
));
$toolHello = $dondominio->tool_hello();All methods will return a DonDominioResponse object containing the data -or any errors- returned by the API call.
Checks that the API is reachable and is working properly.
DonDominioResponse tool_hello ()None
| Field | Type | Description |
|---|---|---|
| ip | string | IP address accessing the API |
| lang | string | Language being used by the API |
| version | string | Current API version |
Converts domain names between Unicode and Punycode (IDNA format).
DonDominioResponse tool_idnConverter ( string $query )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| query | string | Yes | Domain name to be converted |
| Field | Type | Description |
|---|---|---|
| query | string | The original query made |
| unicode | string | The domain name in Unicode format |
| punycode | string | The domain name in Punycode format |
Obtains tables of constants for reference used by some API modules.
DonDominioResponse tool_getTable ( string $tableType )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| tableType | string | Yes | Table to get countries: List of 2-character codes for all countries es_juridic: List of juridic types used by the spanish government |
| Field | Type | Description |
|---|---|---|
| items | array | Array containing the information from the table |
Check the API documentation for more information about tables.
Decodes parameters inside a CSR.
DonDominioResponse tool_csrDecode ( string $csrData )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| csrData | string | Yes | CSR contents (including the ---BEGIN--- and ---END--- lines) |
| Field | Type | Description |
|---|---|---|
| csrData | string | The CSR contents sent |
| commonName | string | CSR common name |
| organizationName | string | Name of the organization associated with the CSR |
| organizationalUnitName | string | Unit name associated with the CSR |
| countryName | string | 2-character code of the country |
| stateOrProvinceName | string | Name of the state or province of the company |
| localityName | string | Name of the locality of the company |
| emailAddress | string | Email address associated with the CSR |