Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 1.91 KB

change-password.mdx

File metadata and controls

75 lines (61 loc) · 1.91 KB
title
Change password

import { Callout } from 'nextra-theme-docs' import { Tab, Tabs } from 'nextra-theme-docs'

Change password

This endpoint changes the password of the vPanel user account associated with the provided information.

HTTP Endpoint

POST https://panel.myownfreehost.net/json-api/passwd.php

Usage

<Tabs items={['cURL', 'Python']}> bash curl -X POST -u username:password -d "user=username&pass=password" "https://panel.myownfreehost.net/json-api/passwd.php" ```python import requests from requests.auth import HTTPBasicAuth

    url = "https://panel.myownfreehost.net/json-api/passwd.php"
    data = {'user': 'username', 'pass': 'password'}  # For the username, use the same username you set when creating the account.

    response = requests.post(url, params=data, auth=HTTPBasicAuth('username', 'password'))

    print(response.json())

    # Do this if you only want to get the status code.
    print(response.json()["passwd"][0]["status"])
    ```
</Tab>

Response

**The above request returns JSON structured like the following:**
```json
{
    "passwd": [
        {
            "statusmsg": "Password changed for user username.",
            "services": [
                {
                    "app": "system"
                },
                {
                    "app": "ftp"
                },
                {
                    "app": "mail"
                },
                {
                    "app": "MySQL"
                },
                {
                    "app": "webdisk (digest)"
                }
            ],
            "rawout": "Password changed",
            "status": 1
        }
    ]
}
```