Open timowevel1 opened 2 months ago
Okay, I updated from 0.5 to 0.10. Now it says `<?xml version="1.0"?>
@DanRiess, @aleixq?
Hey, sorry for the late reply. Webapppasswords share api wrapper works with POST requests only. Try the following:
const result = await fetch(`${this.server}/index.php/apps/webapppassword/api/v1/shares`, {
method: 'POST',
headers: {
Authorization: `Bearer ${this.token}`,
// Authorization: `Basic ${btoa('user:password')}`,
'Content-Type': 'application/json',
'OCS-APIRequest': 'true',
},
body: JSON.stringify({
path: pathToYourFile,
shareType: 3, // check out nextcloud docs for a list of supported share types. The most common one is 3.
password: shareFilePassword,
expireDate: expireDate ? expireDate.toISOString() : null,
}),
})
Hello,
I think its rather an error with the way I use it, but I cannot figure it out.
With postman I tried to test with
GET https://domain/index.php/apps/webapppassword/api/v1/shares?path=/Assessments/Max%20Mustermann/11.09.2024/8ed25dc5-d4f6-4a3f-9e51-05024ccb38e3.mp4
Authorization with Basic
Nextcloud 28.0.5
Header OCS-APIRequest to true
As return in the body it returns me the HTML code of nextcloud `<!DOCTYPE html>
Nextcloud
Internal Server Error
The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
Technical details