Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"URL does not return JSON content" #17

Closed
Disane87 opened this issue Oct 2, 2023 · 6 comments
Closed

"URL does not return JSON content" #17

Disane87 opened this issue Oct 2, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@Disane87
Copy link
Owner

Disane87 commented Oct 2, 2023

actually i input the IP (http://192.168.1.133:7912/), and leave API-Key empty and the error i get is "URL does not return JSON content"

Originally posted by @micro-fx in #15

@Disane87
Copy link
Owner Author

Disane87 commented Oct 2, 2023

When you get the message URL does not return JSON content it seems your spoolman really doesn't return the exppected data. You can try to grab your URL and append api/v1/spool. Like this (only an example: https://spoolman.disane.dev/api/v1/spool)

Now you should get a json with all your spools. In the code I don't do anything else:

url = f"{entry.data[CONF_URL]}{API_SPOOL_ENDPOINT}"

API_SPOOL_ENDPOINT = "/api/v1/spool?allow_archived=false"

This has to work when you get an array of spools as a return of the endpoint. If not, please provide more info.

Hope this helps :)

@micro-fx
Copy link

micro-fx commented Oct 2, 2023

so i added such as http://192.168.1.133:7912/api/v1/spool
and i get some json format, and includes spool info.

so what is the path i should use when adding the HA integration?

if i use the appended url when adding the integration, i get "Failed to connect to the URL. Status code: 404"

@Disane87
Copy link
Owner Author

Disane87 commented Oct 2, 2023

You only need http://192.168.1.133:7912 without trailing slash. That should work.

@Disane87
Copy link
Owner Author

Disane87 commented Oct 2, 2023

@micro-fx I've implemented a check for missing trailing slashes. Unfortunatly there was a bug. You should install the latest version and it should work.

@Disane87 Disane87 added the bug Something isn't working label Oct 2, 2023
@micro-fx
Copy link

micro-fx commented Oct 2, 2023

I can confirm it now works on the new version
image

@Disane87
Copy link
Owner Author

Disane87 commented Oct 2, 2023

Great, thank you for the feedback @micro-fx! Have fun with it! If you have further questions or concerns just hit me up 🆙

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants