Account Information

The Account APIs allow you to retrieve details about the authenticated user (such as their User ID, nickname, and avatar) and monitor storage usage (quota).


Get User Info

Endpoint: GET /api/user/getinfo

This endpoint returns profile information for the current session. It is often used to verify that the ndus cookie is valid and to retrieve the user's unique ID (uk), which is needed for other operations like sharing or transferring files.

Parameters

Parameter Type Required Description
app_id string Yes The application ID. Always 250528.
jsToken string Yes Your session security token.
web string Yes Client platform identifier. Always 1.
channel string Yes Channel identifier. Always dubox.
clienttype string Yes Client type. Always 0.
need_relation int No Set to 0 to exclude relationship info (followers, etc.). Default: 0.
need_secret_info int No Set to 1 to include masked private info (email/phone). Default: 0.

Code Examples

=== "cURL"

```bash
curl "https://1024terabox.com/api/user/getinfo?app_id=250528&web=1&channel=dubox&clienttype=0&jsToken=YOUR_TOKEN&need_relation=0&need_secret_info=1" \
  -H "Cookie: ndus=YOUR_COOKIE" \
  -H "User-Agent: Mozilla/5.0..."
```

=== "Python"

```python
params = {
    'app_id': '250528',
    'web': '1',
    'channel': 'dubox',
    'clienttype': '0',
    'jsToken': js_token,
    'need_relation': '0',
    'need_secret_info': '1'
}

resp = session.get('https://1024terabox.com/api/user/getinfo', params=params)
data = resp.json()

if data['errno'] == 0:
    user = data['records'][0]
    print(f"User: {user['uname']} (ID: {user['uk']})")
```

=== "Node.js"

```javascript
const resp = await client.get('/api/user/getinfo', {
    params: {
        app_id: '250528',
        web: '1',
        channel: 'dubox',
        clienttype: '0',
        jsToken: 'YOUR_TOKEN',
        need_relation: 0,
        need_secret_info: 1
    }
});

if (resp.data.errno === 0) {
    const user = resp.data.records[0];
    console.log(`User: ${user.uname}, ID: ${user.uk}`);
}
```

Response Object

{
  "errno": 0,
  "request_id": 1234567890,
  "records": [
    {
      "uk": 123456789,
      "uname": "HeroBen",
      "nick_name": "Hero",
      "avatar_url": "https://...",
      "email": "te***@gmail.com"
    }
  ]
}

Get Quota

Endpoint: GET /api/quota

This endpoint provides the total storage capacity, used space, and free space in bytes. It is useful for checking if an account has enough space before attempting an upload.

Parameters

Parameter Type Required Description
app_id string Yes Always 250528.
jsToken string Yes Your session security token.
checkexpire int No Set to 1 to check if premium status has expired.
checkfree int No Set to 1 to calculate free space explicitly.

Code Examples

=== "cURL"

```bash
curl "https://1024terabox.com/api/quota?app_id=250528&web=1&channel=dubox&clienttype=0&jsToken=YOUR_TOKEN&checkexpire=1&checkfree=1" \
  -H "Cookie: ndus=YOUR_COOKIE"
```

=== "Python"

```python
params = {
    'app_id': '250528',
    'web': '1',
    'channel': 'dubox',
    'clienttype': '0',
    'jsToken': js_token,
    'checkexpire': '1',
    'checkfree': '1'
}

resp = session.get('https://1024terabox.com/api/quota', params=params)
data = resp.json()

if data['errno'] == 0:
    total_gb = data['total'] / (1024**3)
    used_gb = data['used'] / (1024**3)
    print(f"Storage: {used_gb:.2f} GB / {total_gb:.2f} GB")
```

=== "Node.js"

```javascript
const resp = await client.get('/api/quota', {
    params: {
        app_id: '250528',
        web: '1',
        channel: 'dubox',
        clienttype: '0',
        jsToken: 'YOUR_TOKEN',
        checkexpire: 1,
        checkfree: 1
    }
});

const { total, used } = resp.data;
console.log(`Used: ${used} bytes of ${total} bytes`);
```

Response Object

{
  "errno": 0,
  "total": 1099511627776,
  "used": 52428800,
  "free": 1099459198976,
  "expire": false
}