Skip to content
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

Updating Nextcloud API #803

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TechSupport26
Copy link

Hello.

From my very limited testing and reading this change should work but in practice it appears not to.
What I have tried.
curl -X GET https://dummy.url/ocs/v2.php/cloud/user -u "dummy:random-token-0000-bla-bla-bla" -H "OCS-APIRequest: true"

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message>OK</message>
 </meta>

Etc.

To me that is what we should get.

I tried changing the Nextcloud.php and app.json files in Heimdall/app/SupportedApps/Nextcloud/ to include the changes I have made but it did not work. I get General error connecting with API I am not sure if that is because I have not done something correct locally or if this just does not work.

One other thing is the Password section shows that the first 5 characters of the key is in the App Password box but this happens regardless of me putting in a key or not so is this just a visual thing and intentional?

Can someone please test and check this

Thanks.

@mvdkleijn mvdkleijn added the help wanted Extra attention is needed label Dec 4, 2024
@TheGameProfi
Copy link

Hey there if I saw it correctly the URL isn't correct.
The API Call your making in the Php File is /ocs/v2.php/cloud/userusername where username is a var.
And not /ocs/v2.php/cloud/user like you described.

@TechSupport26
Copy link
Author

TechSupport26 commented Jan 8, 2025

So are you saying it should be like this?

$this->url("/ocs/v2.php/cloud/user/" . $username . "?format=json")

Also, this is where I am looking at. Basic APIs

@TheGameProfi
Copy link

TheGameProfi commented Jan 8, 2025

I checked with my local NC running Version 30.0.4
And there are the endpoint /user (curl -X GET localhost/ocs/v2.php/cloud/user) & /users/{user} (curl -X GET localhost/ocs/v2.php/cloud/users/thegameprofi)
For /user it's Displaying the current User data => this->url("/ocs/v2.php/cloud/user?format=json")
and /users/{user} is displaying the data of a specific User => this->url("/ocs/v2.php/cloud/users/" . $username . "?format=json")
So you could just change the v1 to v2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There the tailing / on the Url is also missing

@TheGameProfi
Copy link

I tested it locally and it working 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Development

Successfully merging this pull request may close these issues.

3 participants