Domains
Achète un domaine : même commande que l'espace client, payée tout de suite avec le solde
POST
/
domains
Achète un domaine : même commande que l'espace client, payée tout de suite avec le solde
curl --request POST \
--url https://kennhosting.com/api/v1/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>",
"years": 5,
"promo_code": "<string>",
"registrant": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postal_code": "<string>",
"postcode": "<string>",
"country": "<string>",
"state": "<string>",
"organization": "<string>",
"firstname": "<string>",
"lastname": "<string>"
}
}
'import requests
url = "https://kennhosting.com/api/v1/domains"
payload = {
"domain": "<string>",
"years": 5,
"promo_code": "<string>",
"registrant": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postal_code": "<string>",
"postcode": "<string>",
"country": "<string>",
"state": "<string>",
"organization": "<string>",
"firstname": "<string>",
"lastname": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: '<string>',
years: 5,
promo_code: '<string>',
registrant: {
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: '<string>',
city: '<string>',
postal_code: '<string>',
postcode: '<string>',
country: '<string>',
state: '<string>',
organization: '<string>',
firstname: '<string>',
lastname: '<string>'
}
})
};
fetch('https://kennhosting.com/api/v1/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://kennhosting.com/api/v1/domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>',
'years' => 5,
'promo_code' => '<string>',
'registrant' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'postcode' => '<string>',
'country' => '<string>',
'state' => '<string>',
'organization' => '<string>',
'firstname' => '<string>',
'lastname' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://kennhosting.com/api/v1/domains"
payload := strings.NewReader("{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://kennhosting.com/api/v1/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kennhosting.com/api/v1/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
Body
application/json
Response
The response is of type object.
⌘I
Achète un domaine : même commande que l'espace client, payée tout de suite avec le solde
curl --request POST \
--url https://kennhosting.com/api/v1/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>",
"years": 5,
"promo_code": "<string>",
"registrant": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postal_code": "<string>",
"postcode": "<string>",
"country": "<string>",
"state": "<string>",
"organization": "<string>",
"firstname": "<string>",
"lastname": "<string>"
}
}
'import requests
url = "https://kennhosting.com/api/v1/domains"
payload = {
"domain": "<string>",
"years": 5,
"promo_code": "<string>",
"registrant": {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postal_code": "<string>",
"postcode": "<string>",
"country": "<string>",
"state": "<string>",
"organization": "<string>",
"firstname": "<string>",
"lastname": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domain: '<string>',
years: 5,
promo_code: '<string>',
registrant: {
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: '<string>',
city: '<string>',
postal_code: '<string>',
postcode: '<string>',
country: '<string>',
state: '<string>',
organization: '<string>',
firstname: '<string>',
lastname: '<string>'
}
})
};
fetch('https://kennhosting.com/api/v1/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://kennhosting.com/api/v1/domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>',
'years' => 5,
'promo_code' => '<string>',
'registrant' => [
'first_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'postcode' => '<string>',
'country' => '<string>',
'state' => '<string>',
'organization' => '<string>',
'firstname' => '<string>',
'lastname' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://kennhosting.com/api/v1/domains"
payload := strings.NewReader("{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://kennhosting.com/api/v1/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kennhosting.com/api/v1/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\",\n \"years\": 5,\n \"promo_code\": \"<string>\",\n \"registrant\": {\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"organization\": \"<string>\",\n \"firstname\": \"<string>\",\n \"lastname\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}