3 GET /service
Thomas Brinkmann edited this page 2 years ago

GET /service - Ruft alle Services ab

Inhalt


  • Parameter
  • Optionale Parameter
  • Beispiel Anfrage
  • Beispiel Antwort
  • Mögliche Fehlermeldungen

Parameter

Es sind keine Parameter notwendig.


Optionale Parameter

Query-String Parameter Typ Beschreibung
?page integer Beschreibt die aktuelle Seitenzahl
?limit integer Beschreibt die Anzahl der Elemente die pro Seite angezeigt werden sollen

Beispiel Anfrage

PHP
<?php 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.dsh.gg/api/v2/service?page=1&limit=10',
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-TOKEN: test-token',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
cURL
curl --location --request GET 'https://api.dsh.gg/api/v2/service?page=1&limit=10' \
--header 'X-TOKEN: test-token' \
--header 'Content-Type: application/json' 

Beispiel Antwort

{
    "status": "OK",
    "totalResults": 40,
    "page": 1,
    "itemsPerPage": 10,
    "maxPages": 4,
    "items": [
        {
            "serviceid": 12345,
            "product_id": 1,
            "name": "VPS 2G",
            "domain": "",
            "dedicatedip": "x.x.x.x",
            "assignedips": "",
            "suspensionreason": "",
            "firstpaymentamount": "0.00",
            "recurringamount": "0.00",
            "regdate": "2000-00-00",
            "nextduedate": "2000-00-00",
            "paymentmethod": "paypal",
            "billingcycle": "Monthly",
            "status": "Active",
            "customfields": [],
            "configoptions": [
                {
                    "id": 1,
                    "option": "CPU",
                    "type": "dropdown",
                    "value": "4vCores"
                },
                {
                    "id": 1,
                    "option": "RAM",
                    "type": "dropdown",
                    "value": "2048MB"
                },
                {
                    "id": 1,
                    "option": "Speicherplatz",
                    "type": "dropdown",
                    "value": "100GB HDD"
                },
                {
                    "id": 1,
                    "option": "Betriebssystem",
                    "type": "dropdown",
                    "value": "Windows Server 2012 R2"
                },
                {
                    "id": 1,
                    "option": "Anbindung",
                    "type": "dropdown",
                    "value": "1Gbit/s"
                },
                {
                    "id": 1,
                    "option": "DDoS Protection",
                    "type": "dropdown",
                    "value": "inklusive"
                },
                {
                    "id": 1,
                    "option": "Standort",
                    "type": "dropdown",
                    "value": "Frankfurt am Main"
                }
            ]
        },
        {
            "serviceid": 1234,
            "product_id": 1,
            "name": "RS Big 2020",
            "domain": "test.server",
            "dedicatedip": "x.x.x.x",
            "assignedips": "x.x.x.x",
            "suspensionreason": "",
            "firstpaymentamount": "0.00",
            "recurringamount": "0.00",
            "regdate": "2000-00-00",
            "nextduedate": "2022-00-00",
            "paymentmethod": "paypal",
            "billingcycle": "Monthly",
            "status": "Active",
            "customfields": [],
            "configoptions": [
                {
                    "id": 1,
                    "option": "CPU Cores",
                    "type": "dropdown",
                    "value": "3 Cores Intel Xeon"
                },
                {
                    "id": 1,
                    "option": "Arbeitsspeicher (GB)",
                    "type": "dropdown",
                    "value": "13GB ECC RAM"
                },
                {
                    "id": 1,
                    "option": "SSD Speicherplatz",
                    "type": "dropdown",
                    "value": "150GB SSD"
                },
                {
                    "id": 1,
                    "option": "IPv4 Adressen",
                    "type": "dropdown",
                    "value": "1 IPv4 Adresse"
                },
                {
                    "id": 1,
                    "option": "IPv6 Adressen",
                    "type": "dropdown",
                    "value": "keine IPv6 Adresse"
                },
                {
                    "id": 1,
                    "option": "Traffic",
                    "type": "dropdown",
                    "value": "Unlimited Flat - FairUse"
                },
                {
                    "id": 1,
                    "option": "Betriebssystem",
                    "type": "dropdown",
                    "value": "Ubuntu18-64Bit"
                },
                {
                    "id": 1,
                    "option": "Backup Slots",
                    "type": "dropdown",
                    "value": "2 Backup Slots"
                }
            ]
        }
    ]
}

Mögliche Fehlermeldungen

Status Code 500 Failed to fetch service details.