Save (Transfer)

The Save API allows you to transfer files from another user's public share link directly into your own Terabox drive.

1. Resolve Link

Endpoint: GET /share/list

Before you can transfer files, you must "resolve" the short link (e.g., 1abc...) to obtain the shareid and the sharer's User ID (uk).

Parameters

Parameter Type Required Description
shorturl string Yes The code part of the link (e.g., 1abc from terabox.com/s/1abc).
root int No 1 to list the root of the share.
page int No Page number.
jsToken string Yes Session token.

Code Examples

=== "cURL"

```bash
curl "https://1024terabox.com/share/list?shorturl=1aBcDeF&root=1&page=1&jsToken=TOKEN" \
  -H "Cookie: ndus=YOUR_COOKIE"
```

=== "Python"

```python
short_code = "1aBcDeF" # from terabox.com/s/1aBcDeF

params = {
    'shorturl': short_code,
    'root': '1',
    'page': '1',
    'jsToken': js_token
}

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

# You need these values for Step 2
shareid = data['shareid']
from_uk = data['uk']
files = data['list'] # Contains fs_id needed for transfer
```

=== "Node.js"

```javascript
const resp = await client.get('/share/list', {
    params: {
        shorturl: '1aBcDeF',
        root: 1,
        page: 1,
        jsToken: 'TOKEN'
    }
});
const { shareid, uk, list } = resp.data;
```

2. Transfer Files

Endpoint: POST /share/transfer

This endpoint executes the transfer.

Parameters

Parameter Type Required Description
shareid int Yes Retrieved from Step 1.
from int Yes The uk (User Key) of the sharer from Step 1.
ondup string Yes Conflict resolution: overwrite or newcopy.
bdstoken string Yes Required for write operation.
jsToken string Yes Required.

Body Data: * fsidlist: JSON array of File IDs (fs_id) from the shared list to save. * path: The absolute path in your drive where files should be saved.

Code Examples

=== "cURL"

```bash
curl -X POST "https://1024terabox.com/share/transfer?shareid=ID&from=UK&ondup=newcopy&jsToken=TOKEN&bdstoken=TOKEN" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "fsidlist=[12345]&path=/MySavedFiles"
```

=== "Python"

```python
# IDs of files to save
fs_id_list = [f['fs_id'] for f in files]

params = {
    'shareid': shareid,
    'from': from_uk,
    'ondup': 'newcopy', # 'overwrite' or 'newcopy'
    'jsToken': js_token,
    'bdstoken': bdstoken
}

data = {
    'fsidlist': json.dumps(fs_id_list),
    'path': '/MySavedFiles' # Destination in your drive
}

resp = session.post('https://1024terabox.com/share/transfer', params=params, data=data)
print(resp.json())
```

=== "Node.js"

```javascript
const qs = require('qs');

const data = qs.stringify({
    fsidlist: JSON.stringify([12345]), // IDs from Step 1
    path: '/MySavedFiles'
});

await client.post('/share/transfer', data, {
    params: {
        shareid: shareid,
        from: uk,
        ondup: 'newcopy',
        jsToken: 'TOKEN',
        bdstoken: 'TOKEN'
    }
});
```