Skip to main content

Can not edit package via api if it not begins with root_ in name

Comments

2 comments

  • cPanelLauren
    To confirm you're using WHM API 1 Functions - editpkg - Developer Documentation - cPanel Documentation And what are the parameters you're using exactly? I tested this on my own server and I'm not seeing any issues [root@server packages]# whmapi1 editpkg name=cptest_usercreatedpackage featurelist=default quota=10240 language=en max_emailacct_quota=1024 maxftp=unlimited maxsql=unlimited maxpop=unlimited maxlists=unlimited maxsub=5 maxpark=5 maxaddon=5 --- data: pkg: cptest_usercreatedpackage metadata: command: editpkg reason: OK result: 1 version: 1
    I created this package with my reseller account, within WHM, then logged in through terminal and ran the command line function. I'm also unable to replicate package addition automatically appending root to the package: [root@server packages]# whmapi1 addpkg name=package1234 featurelist=default quota=unlimited --- data: pkg: package1234 metadata: command: addpkg reason: OK result: 1 version: 1
    [root@server packages]# ls -lah /var/cpanel/packages/package1234 -rw-r--r-- 1 root root 355 Jun 16 14:19 /var/cpanel/packages/package1234
    0
  • amaurigabriel
    Hi, I am using WHM api. If I run whmapi1 using the terminal, I can edit any package that I want. But I am using the API via CURL, and if I create a package with my token, it get prepended with "root" in the name automatically. Also, if I try to edit any package that not begins with "root_" I got the previous error. If I try to edit it any package that starts with "root_" it works fine. A minimalist example is: [CODE=bash]curl -XGET -H 'Authorization: whm root:MYTOKEN' -d 'name=TESTE' 'https://myserver:2087/json-api/editpkg'
    It will return the previous error. If I run [CODE=bash]curl -XGET -H 'Authorization: whm root:MYTOKEN' -d 'name=TESTE' 'https://myserver:2087/json-api/addpkg'
    then the package root_TESTE is created.
    0

Please sign in to leave a comment.