Articles in this section

Plesk API fails to create FTP user: Element 'webspace-id': '0' is not a valid value of the atomic type 'id_type'

kb: bug Plesk for Linux kb: technical api

Applicable to:

  • Plesk for Linux

Symptoms

Creating an additional FTP user over the Plesk API fails:

# curl -k -u admin:'passXXXX' -X POST -d @plesk-ftp.json "http://<hostname>:8443/api/v2/ftpusers"

"code": 1014, 
"message": "Parser error: Request is invalid. Error in line 1: Element 'webspace-id': '0' is not a valid value of the atomic type 'id_type'."

Cause

This is caused a by a product issue: EXTREST-158. It will be fixed in future updates.

Resolution

The product issue has been fixed. Update Plesk to latest version.

Note: internal workaround before the fix

  1. Create a secret key (X-API-Key):

    # curl -iku admin:password -X POST -H 'Content-Type: application/json' -d'{}' https://hostname:8443/api/v2/auth/keys

  2. Run this API-CLI call:

    # curl -k -X POST "https://hostname:8443/api/v2/cli/ftpsubaccount/call" \
    -H "X-API-Key: 67X1fX25-24dX-5eX8-bXe1-d9566X4Xf4X9" \ 
    -H 'accept: application/json' \ 
    -H 'Content-Type: application/json' \ 
    -d '{ "params": ["--create", "jdoe", "-domain", "example.com", "-home", "/httpdocs", "-passwd", "password"]}'

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.