Sesame Disk for Developers: Connect with Our Seafile REST API
Sesame Disk provides a powerful REST API based on Seafile, allowing developers to integrate secure cloud storage into their applications.
Why Use the Sesame Disk API?
β
Automate file management: Upload, download, and organize files programmatically.
β
Seamless integration: Connect your app to our cloud without complex configurations.
β
Cross-platform support: Works with any programming language that supports HTTP requests.
π API Server Endpoint
All API requests must be sent to our dedicated server:
https://app.nihaoconsult.com/
Make sure to include this base URL in all your API calls. For example, the full endpoint to authenticate would be:
POST https://app.nihaoconsult.com/api2/auth-token/
This ensures your requests are directed to the correct server for secure and seamless integration.
1οΈβ£Get Your Authentication Token
Before making API requests, you need to authenticate and obtain an access token.
π Endpoint: POST /api2/auth-token/
π» Example in cURL
curl -X POST https://app.nihaoconsult.com/api2/auth-token/ \
-d "[email protected]&password=your_password"
π» Example in Python
import requests
url = "https://app.nihaoconsult.com/api2/auth-token/"
data = {"username": "[email protected]", "password": "your_password"}
response = requests.post(url, data=data)
print(response.json()) # {"token": "your_api_token_here"}
π» Example in Node.js
const axios = require('axios');
axios.post('https://app.nihaoconsult.com/api2/auth-token/', {
username: '[email protected]',
password: 'your_password'
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
π Response Example:
{
"token": "your_api_token_here"
}
Save this token, as youβll need it in all future requests.
2οΈβ£ Make an API Call
Once authenticated, you can use the token to make API requests.
Hereβs how you can list all your libraries (file repositories).
π Endpoint: GET /api2/repos/
π» Example in cURL
curl -X GET https://app.nihaoconsult.com/api2/repos/ \
-H "Authorization: Token your_api_token_here"
π» Example in Python
headers = {"Authorization": "Token your_api_token_here"}
response = requests.get("https://app.nihaoconsult.com/api2/repos/", headers=headers)
print(response.json())
π» Example in Node.js
axios.get("https://app.nihaoconsult.com/api2/repos/", {
headers: { Authorization: "Token your_api_token_here" }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
π Example Response:
[
{
"id": "123abc...",
"name": "My Library",
"size": 10485760,
"mtime": 1700000000,
"encrypted": false
}
]
π Explore More Features
This is just the beginning! With our API, you can:
β
Upload & download files
β
Create & manage folders
β
Share secure links
β
Manage user permissions
π Check out the full API documentation here:
π Seafile API Docs
π‘ Need help? Contact our support team! π