Skip to main content

listsuspended

List Suspended Accounts

To find suspended Eenos hosting accounts.

Required Parameters

Field Description Example
apiuser API user  name eenos_api
apiauth API  user password eenos123

Status  Codes

Code Description
200 OK, Success
500 Server Error
403 Forbidden 
400 Bad request

Request URL

Post url  = /listsuspended/

Default Full URL =  https://your-host-name:5555/api/listsuspended/

Version Full URL =  https://your-host-name:5555/api/v1/listsuspended/

Sample Curl Code

#!/bin/bash
REQUEST_URL="/listsuspended/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# BASE_URL="https://your-host-name:5555/api/v1"
API_URL="$BASE_URL$REQUEST_URL"
/usr/bin/curl -X POST $API_URL \
    -d "apiuser=eenos_api" \
    -d "apiauth=eenos123" 

Sample Output

{
   "data" : {
      "accounts" : {
         "dreamcatcher" : {
            "reason" : "test",
            "suspendtime" : "Sun, 07-Feb-2021 10:35:02, America/Los_Angeles",
            "user" : "dreamcatcher"
         },
         "mysite" : {
            "reason" : "not paid",
            "suspendtime" : "Thu, 11-Nov-2021 11:45:19, America/Los_Angeles",
            "user" : "mysite"
         }
      }
   },
   "info" : "Suspend hosting accounts",
   "status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/listsuspended/'
# The server api base url
base_url='https://your-host-name:5555/api'
# Default  base url
# base_url='https://your-host-name:5555/api'
# Version specific base url
# base_url='https://your-host-name:5555/api/v1'
# The api url 
api_ulr=base_url+request_url
# The data in dictionary format
data={
    'apiuser': 'eenos_api',
    'apiauth':'eenos123',        
}
try:   
    result=requests.post(api_ulr, data = data)
    pprint(result.json())
except Exception as e:
    pprint(str(e))
    pass
PHP Code
<?php
// The API request url
$request_url='/listsuspended/';
// Your server API base url
$base_url='https://your-host-name:5555/api';
// Default base url
// $base_url='https://your-host-name:5555/api';
// Version specific base url
// $base_url='https://your-host-name:5555/api/v1';
// The FULL API URL
$api_url=$base_url.$request_url;
//The data you want to send via POST
$fields= [
    'apiuser'   =>  'eenos_api',
    'apiauth'   =>  'eenos123',    
];
//url-ify the data for the POST
$fields_string = http_build_query($fields);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $api_url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 
//execute post
$result = curl_exec($ch);
//Print the json result
echo json_encode(json_decode($result), JSON_PRETTY_PRINT);
?>