API output

renholm

New member
Joined
Feb 3, 2004
Messages
4
Hello,

When working with some of the API commands (e.g. CMD_API_SHOW_ADMINS) I got an ordinary webpage back as a response when trying to access the API command with a reseller account. Wouldn’t it be better if the response where something like “error=1&text=text&details=details”? Is this a bug or is this behaviour by design?

Thanks in advance!
 
Hello,

When I go to /CMD_API_SHOW_ADMINS, i get
Code:
list[]=admin
.. not sure why you'd get a web page.. is it the page for the regular 'show admins' page, and if so, double check that you're using the API version.

John
 
Thanks for your reply!

When I'm trying to access the /CMD_API_SHOW_ADMINS with a reseller accout i got the following response from the server:

Code:
"text/css">
        *
{
        FONT-SIZE: 8pt;
        FONT-FAMILY: verdana;
        zoom: 100%;
}

b
{
        FONT-WEIGHT: bold;
}

.toptext
{
        COLOR: #BBBBBB;
}
.bottomtext
{
        COLOR: #EEEEEE;
}


a
{
        TEXT-DECORATION: underline;
        COLOR: black;
}

a:hover
{
        COLOR: #9999CC;
}

u
{
        TEXT-DECORATION: underline;
}

.tree
{
        COLOR: #DEDEDE;
}

.title
{
        COLOR: #000000;
        FONT-WEIGHT: bold;
        FONT-SIZE: 12pt;
}

.header
{
        FONT-WEIGHT: 600;
        FONT-SIZE: 10pt;
        COLOR: #123456;
}

.button
{
        FONT-SIZE: 12pt;
        border: 1px solid white;
}

a.button
{
        TEXT-DECORATION: none;
}

a.button:hover
{
        TEXT-DECORATION: none;
        COLOR: black;
}

.highlighted
{
        border: 1px solid grey;
        border-style: outset;
        cursor: hand;
}

table.list
{
        BACKGROUND: #FFFFFF;
        width: 100%;

}

td.list
{
        BACKGROUND: #EEEEEE;
        white-space: nowrap;
}

td.listwrap
{
        BACKGROUND: #EEEEEE;
        white-space: wrap;
}

.listtitle
{
        BACKGROUND: #425984;
        COLOR: #EEEEEE;
        white-space: nowrap;
}

td.listtitle
{
        border: 1px solid grey;
        border-style: outset;
        background-image: url("IMG_BG");
}

        </style>
</HEAD>

<BODY background="/IMG_BG" leftMargin=0 rightMargin=0 topMargin=3 bottomMargin=0
>

<TABLE width=100% cellSpacing=0 cellPadding=0 bgColor=#334263 background=/IMG_BG
>
        <TR>
                <TD align=left>

                        <img border="0" src="/IMG_BANNER" width="340" height="45
">
                </TD>
                <TD align="right">
                        <a href="/CMD_LOGOUT"><img border="0" src="/IMG_SIGNOUT"
 width="120" height="28"></a><a href="/HTM_PASSWD"><img border="0" src="/IMG_PAS
SWORD" width="120" height="28"></a><a target="help" href="http://www.site-helper
.com"><img border="0" src="/IMG_HELP" width="120" height="28"></a>
                </TD>
        </TR>
        <TR>
                <TD bgColor=#334263 colSpan=2 height=1><IMG height=1 alt="" src=
"/IMG_PIX" width=1 border=0></TD>
        </TR>
</TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TR>
                <TD bgColor=#334263 height=21>
                        <TABLE cellSpacing=0 cellPadding=3 width=100% border=0>
                                <TR>
                                <TD class=tree>
                                        res2
tree href="/">Home</a>
tree href="none">Back</a>
                                </TD>
                                <TD class=bottomtext width="30%" align=right>
                                        <a class=bottomtext href="/CMD_TICKET">M
essage System</a> - 0 messages waiting
                                </TD>
                                </TR>
                        </TABLE>
                </TD>
        </TR>
        <TR>
                <TD bgColor=white align=center height=375>
                        <table cellspacing=0 cellpadding=0 width=500 border=0>
                                <tr><td align=center>

<br><br>
<table width=100% height=100% cellspacing=0 cellpadding=5>
    <tr>
      <td height="50%" valign="middle" align="center">
        <p align="center">You cannot execute that command</p>
      </td>
    </tr>
    <tr>
        <td height=1 valign="middle" align="center">
                <table width = 50%>
                        <tr><td bgcolor="#C0C0C0"> </td></tr>
                </table>
        </td>
    </tr>
    <tr>
      <td height="50%" valign="middle" align="center">
        <p align="center"><b>Details</b></p>
        <p align="center">The request you've made cannot be executed because it
does not exist in your authority level</p>
      </td>
    </tr>
</table>
<br><br>
                                        </td>
                                </tr>
                                <tr>
                                        <td>
#334263 height=21>
                        <TABLE cellSpacing=0 cellPadding=3 width=100% border=0>
                                <TR>

<TD class=bottomtext>

bottomtext href="/">Reseller Panel</a>
                                </TD>
                                <TD class=bottomtext>

bottomtext href="/HTM_INDEX_USER">User Panel</a>
                                </TD>
                                        <TD width=* align=right class=toptext>
                                                Last sign in:
nbsp; Feb 4, 2004 at 17:31
nbsp; from 217.210.15.218
nbsp;
nbsp;
toptext href="/CMD_LOGIN_HISTORY">Login history</a>]
                                        </TD>
                                </TR>
                        </TABLE>
                </TD>
        </TR>

</TABLE>

<br>
<center class=bottomtext>
<a class=bottomtext href="http://www.directadmin.com">DirectAdmin</a> Web Contro
l Panel
nbsp; 2003 JBMC Software
</center>

</BODY></HTML>
According to the message in the response ”You cannot execute that command”, I draw the conclution that reseller accounts can’t access this command, but the problem is that I would prefer a more simpler response than a whole page.
 
Hello,

Ok, that makes more sense. The thing with the permissions on commands is that they're checked far before the actual command is executed. Generally you just figure it out once, and make sure your script is using the correct account type for the next time :)

John
 
Back
Top