SmarterMail API > System Admin > ListAliases
Question asked by Ronald Raley - 8/9/2020 at 2:13 AM
Answered
I'm working on a new project and am using the new SmarterMail API v1.  I do not see a way to list aliases for a domain.  Any help would be appreciated.  If not available, please consider.

Thanks,
Ron

6 Replies

Reply to Thread
0
Robert Emmett Replied
Employee Post
Robert Emmett
Software Developer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
0
Ronald Raley Replied
Robert, thanks for the information.  I am actually looking for e-mail aliases (that are addresses that forward to multiple recipients) versus "Domain Aliases".  I should have been more clear.

I see getAlias.  However, I do not see ListAlias.  I also think this would beneficial under Domain Settings and System Admin.

I am building an overview page that simply lists user accounts, aliases, mailbox sizes, and mailbox limits.

Thanks!
Ron
0
Robert Emmett Replied
Employee Post Marked As Answer
Domain Settings > AccountListSearch and set the searchFlag string array to include "aliases".  I've included a screenshot of the request payload.  I hope this helps.

Robert Emmett
Software Developer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
0
Ronald Raley Replied
Robert,

Appreciate the follow-up.  It looks like this will work.  However, it is not available to my System Admin token.  So additional steps are required.

We have 400+ domains with inconsistent Domain Admin passwords, making it difficult to secure a Domain Admin token.

I must first use api/v1/settings/sysadmin/user/{email} to get the password.
Then I must use api/v1/auth/authenticate-user to get the token.
Then I can finally use api/v1/settings/domain/account-list-search to retrieve the aliases

Thanks,
Ron
0
Sébastien Riccio Replied
Hello Ronald,

While it is true you need to swtich do a domain admin context to call the account-list-search function, you do not need the domain administrator password to do the switch.

When you're authenticated as a system admin you can call sysadmin/manage-domain to retrieve an auth token valid for the corresponding domain administrator context and then use it to do your calls on domains admin functions.


Then you can switch back to the system admin token when done.

Well, that's how we did it when we rewrote the SmarterMail implementation in our home made control panel to use the new API instead of the legacy (but easier to use...) Soap API.

Kind regards.

Sébastien Riccio
System & Network Admin

0
Ronald Raley Replied
Sébastien,

Thank you!  This make sense.

I have 2 furry friends with Swiss heritage, a St. Bernard and a Bernese Mountain Dog.  Both breeds originated as working dogs in the Swiss Alps.

Ron

Reply to Thread