Skip to main content

Accessing CPanel UAPI from command line on Linux / Mac OS

Comments

1 comment

  • AndrewH.
    I tried running a similar command on my development box and got this response
    devserver:2083/execute/Email/add_forwarder?email=reseller%40reseller.tld&fwdopt=pipe&pipefwd=echo

    {"messages":null,"errors":null,"status":1,"metadata":{"transformed":1},"data":[{"email":"reseller@reseller.tld","domain":"reseller.tld","forward":"|/home/reseller/echo"}]}
    I also did this command to match yours
    devserver:2083/execute/Email/add_forwarder?email=reseller&fwdopt=pipe&pipefwd=echo&domain=reseller.tld

    {"messages":null,"errors":null,"status":1,"metadata":{"transformed":1},"data":[{"email":"reseller@reseller.tld","domain":"reseller.tld","forward":"|/home/reseller/echo"}]}
    and had success as well. Now when I tried an account that I didn't have access to I got this response
    devserver:2083/execute/Email/add_forwarder?email=reseller&fwdopt=pipe&pipefwd=echo&domain=notsomethingiown.tld

    {"messages":null,"errors":["Error opening "/etc/valiases/notsomethingiown.tld" to write: Permission denied at /usr/local/cpanel/Cpanel/Email/Aliases.pm line 114.\n">,"status":0,"metadata":{},"data":null}
    At this point I'm unsure why success or failure data isn't being generated for you. I would recommend opening a ticket as our support team is amazing and should be able to help you out.
    0

Please sign in to leave a comment.