-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document HTTP API #1
Comments
😮 Yes, I have to write the docs for the web API. There was someone else who asked me the same too. |
It is 2020, please where is the doc? |
+1 for such doc. |
I'm not quite sure if anyone is already using API's , I tracked the API calls from chrome for few POST calls like create user, the tricky part was to get the auth cookie , once you have it you can just wire your own python/curl etc. Get Auth Cookie:
|
i already have half documented the api by reverse way of interaction.. but i still waithing to the current merge request will be done @on4r thanks in advance |
6 years later, still no docs. Is there some tool to auto-generate these? |
@gaby the problem is the autor itselft.. it seems do not care about that |
2000 years later... |
Is there already an update on the documentation? With a bunch of trial and error I managed to obtain the JWT token, but using it to authenticate has so far been impossible. This is the simple node script I wrote to try and download a testfile: import axios from 'axios';
import fs from 'fs';
async function getToken() {
const response = await axios.post('http://localhost:8080/api/login', {
username: 'MY_USERNAME',
password: 'MY_PASSWORD'
});
return response.data;
}
async function downloadFile(token) {
const url = 'http://localhost:8080/api/resources/test';
const response = await axios({
method: 'GET',
url: url,
responseType: 'stream',
headers: {
Authorization: `Bearer ${token}`
}
});
const writer = fs.createWriteStream('DownloadedTextFile.txt');
response.data.pipe(writer);
return new Promise((resolve, reject) => {
writer.on('finish', resolve);
writer.on('error', reject);
});
}
async function main() {
const token = await getToken();
console.log('Token: ' + token);
if (token) {
await downloadFile(token);
} else {
console.log('No token. Aborting.');
}
}
main().catch((e) => {
console.error('Error: ', e);
}); This obtains a token, but when downloading the file using the token I get a '401 unauthorized' error. |
@icheered i am thinking of possible cuases: there is another way apart of i dont know i am not expert in promise |
I figured it out after a while, but it turns out you don't use |
yeah.. unfortunatelly .. many times i proposed forked the project but we need at least 2 mantainers for filebrowser and 1 for docs |
It is an open source project. Any help in appreciated. You can help the community by writing API docs and opening a PR. |
@o1egl thanks for response, finally you revive, we already provide some contributed parts.. |
This gives me a 401 unauthorized despite having a cookie that was created from an admin account. Do you have an up to date example of how to add a user with a HTTP request? |
como puedo usar el token para loguearme automáticamente en filebrowser, esto es lo que tengo con php: $data = array( |
You should change:
|
How to automatically log in to file browser after receiving a token? I have this now:
|
Check filebrowser/filebrowser#2551. |
I know about it. But how to redirect to http://localhost:8084/files/ page already signed-in with the provided credentials and recieved token? Basically i want to have a link that automatically sign-in user. |
Still no docs for APIs lol |
Anyone know what APIs I could use to upload files to filebrowser? I essentially want to do the equivalent of dragging and dropping some files in to the filebrowser UI but with HTTP APIs. Something like:
|
Just this sample script which solves my use case nicely. Thanks. filebrowser/filebrowser#2551 |
The Web API is nice. It would help if this was documented so that it can be integrated into other systems. I have a distributed FS and use
filemanager
has the front-end for all of this.When a user is created in our system we create one in filemanager user with a scope. So that it acts like a multi-tenant system. It's beautiful. We had to read through the web app to + code find endpoints.
Should have been documented.
The text was updated successfully, but these errors were encountered: