Roller Network Help - Account Manager API (Legacy)
This API is deprecated and will be removed in the future. New integrations should use the REST API.
Account Control Center REST API documentation
- Configuring the API
- API Overview
- Valid User Table "rmap" Method
- Mail Domains "maildomain" Method
- Secondary DNS "secdns" Method
- Mail Queue "mailqueue" Method
- Hosted Mail Box "mailbox" Method
- Perl Module Interface
Account Manager API
Please note: the Account Manager API is provided for advanced users only.
The Roller Network Account Manager API allows our services and systems to be integrated into an existing system or infrastructure. Security is through an "access key" which can limit access to areas of the account manager by permissions settings and source IP address without revealing your account login. Before using the API a key must be configured to allow access.
By using a system of keys and (optional) IP address restrictions, the API can be used to integrate the account manager into an existing system. This is currently performed by executing HTTP/HTTPS calls to the API in a GET or POST method.
Before the API can be used, a key and optional IP address must be added on the API page. The API key can be any combination of characters up to 127 characters long. If the IP address is left as 0.0.0.0, the account manager will allow any IP address utilizing the key. If an IP address (or IP range in CIDR slash-mask format) is given, only requests from that IP address will be authorized.
When adding a key, check each group of functions the key may use. Unchecked groups are denied. After a key has been added it will appear in the list of keys.
Once added, the key, IP address and permissions can not be changed. The key must be deleted and a new key added in order to change these values.
The API may be accessed by making a HTTPS request, in GET or POST mode, to the address https://acc.rollernet.us/api/api.php and passing it the following variables:
The API will only return two values when a request is made: OK or ERROR. No details on error will be provided through the API; they are available in the API log on the API page. This is an example of a request using HTTPS and GET:
Each of the required variables has the following value:
This would request the API to add "user@mydomain.com" to the valid user table for the account "myuser" using the authorization key "mykey". If this action was successful, the API would return OK. If the action failed for any reason, the API would return ERROR. All API activity is logged in the account manager.
Depending on the platform used to send the API requests, the non-alphanumeric characters in variable values may require encoding. The encoded version of the same example above is:
Valid User Table "rmap" Method
The "rmap" method provides an interface to the valid user table feature. This function was also called "Recipient Maps" in the past. It allows a valid user entry to be added or removed and for the domain mode to be changed. The following actions are provided to the rmap module:
For the add and del actions, the data variable d is a valid email address in user@domain.com format. All other actions require the data variable d to be a valid domain name.
The mode action will return OK followed by a new line with the mail domain name and a mode=x value where x will be one of: hosted (a hosted mail domain), allow (default allow policy), deny (default deny policy), defer (defer incoming policy), auto (automatic learning mode), global (use global valid user table policy).
Examples
Returns OK if successful. This action will also return ERROR if the entry is a duplicate or d is not a valid email address.
Always returns OK, even if the entry does not exist, unless d is not a valid email address.
Returns OK unless d is not a valid domain name.
Mail Domains "maildomain" Method
The "maildomain" method allows the API to add, delete, enable, and disable mail domains. The following actions are provided to the maildomain module:
For all actions, the value of d passed to the API must be a valid domain name. If it is not, ERROR will be returned.
Extended Data Format
The SMTP Redirection action requires a host and port, in addition to the domain name. This is passed to the API by setting the data d value to "domain.com|destination.host.com:port". Example:
Examples
Returns OK if successful. This action will return ERROR if the entry is a duplicate or already exists in another account.
Returns OK if domain exists and was successfully removed. Returns ERROR if the domain is invalid, does not exist, or is not associated with this account.
Returns OK if domain was disabled, regardless of previous state. Returns ERROR if the domain is invalid, does not exist, or is not associated with this account.
Returns OK if domain was enabled, regardless of previous state. Returns ERROR if the domain is invalid, does not exist, or is not associated with this account.
The "secdns" method allows the API to add, delete, enable, and disable secondary DNS domains. The following actions are provided to the secdns module:
For all actions, the value of d passed to the API must be a valid domain name. If it is not, ERROR will be returned.
Important: Since a master needs to be specified when adding Secondary DNS domains, the data d variable requires an additional parameter. Multiple parameters are separated by the pipe character "|". To use the add action, specify d as "domain|master". This format may be used with other actions; the master portion will be ignored.
Examples
Returns OK if successful. This action will return ERROR if the entry is a duplicate, bad master format, or already exists in another account.
Returns OK if domain exists and was successfully removed. Returns ERROR if the domain is invalid, does not exist, or is not associated with this account.
Returns a list of secondary DNS zones in the format zone,status,master terminated with OK. The domain d input is required, but is ignored and may be left blank. Status is 0 (zero) for disabled and 1 (one) for enabled.
The "mailqueue" method lets you retrieve information on a queue and execute an ETRN. Its functionality is identical to the mail queue status page. The following actions are provided to the mailqueue module:
For the status action, the value of d passed to the API should be a mail domain name or empty string. If it is an empty string or contains an invalid mail domain, the queue status of all domains is returned. If a valid domain name is given for the value of d only the status of that domain will be returned.
The format of the queue status is one line per mail domain as follows:
<mail domain name>,<mail.rollernet.us count>,<mail2.rollernet.us count>
Examples
For the etrn action the value of d must be a valid mail domain. If it is not, ERROR will be returned. ERROR may also be returned if the etrn action failed, otherwise OK will be returned.
Hosted Mail Box "mailbox" Method
The "mailbox" method lets you perform actions on hosted mail boxes. The following actions are provided to the mailbox module:
This method requires multiple data d inputs in an array form depending on the action. They are:
Both passwd and vpasswd will use the value supplied in d[p] as the new password for the mail box account named in the d[u] value. If the mail box does not exist ERROR will be returned. OK will be returned if the password was successfully changed.
The only difference between passwd and vpasswd is that vpasswd requires the current password to be provided in the d[vp] input; ERROR will be returned if it does not match the current password. This allows the API to be used to build a customer-facing password change form whereas passwd should only be used as a trusted administrative function.
When using the add method you can create regular user accounts by passing d[u] with value mailbox@example.com or any user (dropbox, catchall) accounts with value @example.com.
Examples
- RollernetClient.pm Version 1.0 (Contributed by Keith Wessel)
