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

Handling Asset Files with API not working #16135

Open
bastian-albaut opened this issue Jan 27, 2025 · 2 comments
Open

Handling Asset Files with API not working #16135

bastian-albaut opened this issue Jan 27, 2025 · 2 comments
Assignees
Labels
api ✋ bug Confirmed bug 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick!

Comments

@bastian-albaut
Copy link

Hello,

I try to use the API to upload or list files of an asset, but in both cases it's not working and I have the same response :

{
    "status": "success",
    "messages": "File(s) successfully uploaded.",
    "payload": null
}

Even for the GET request to list files I have the message "File(s) successfully uploaded" that is weird.

To debug I try to do a simple request to retrieve an asset :
GET http://<snipe.it.url>/api/v1/hardware/652/ with my api key.

This works well:

{
    "id": 652,
    "name": "...",
    "asset_tag": "...",
    "serial": "...",
...
}

But for these requests :
GET http://<snipe.it.url>/api/v1/hardware/652/files
and
POST http://<snipe.it.url>/api/v1/hardware/652/files
It's not working and I have the weird response :

{
    "status": "success",
    "messages": "File(s) successfully uploaded.",
    "payload": null
}

I also try to add manually a file in my asset through the dashboard but here is no change...

@bastian-albaut bastian-albaut changed the title Handling Asset Files not working Handling Asset Files with API not working Jan 27, 2025
@snipe
Copy link
Owner

snipe commented Jan 27, 2025

I just noticed this recently on the model files uploads too (and fixed it there.) I'll take a look.

@snipe snipe added ✋ bug Confirmed bug 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick! api labels Jan 27, 2025
@snipe snipe self-assigned this Jan 27, 2025
@bastian-albaut
Copy link
Author

Okay thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api ✋ bug Confirmed bug 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick!
Projects
None yet
Development

No branches or pull requests

2 participants