snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.21k stars 3.2k forks source link

Add a component to the asset via API #9280

Open Weapie opened 3 years ago

Weapie commented 3 years ago

I have been looking for a solution for a while. I want to pass calculator information to SnipeIT via the API and also attach the components to the assets. I just can't find a way to do this in the docs. Is there this possibility in the API? Otherwise I would like to have it in it.

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

boring10 commented 3 years ago

According to the format for their API, and the request from the website, this is an example what you would use.

{
  "method": "post",
  "baseURL": "https://develop.snipeitapp.com/api/v1/components/1/checkout",
  "url": "",
  "headers": {
    "authorization": "Bearer [API KEY HERE]",
    "accept": "application/json",
    "content-type": "application/json"
  },
  "data": { "asset_id": 1, "assigned_qty": 1 }
}

Unfortunately, this returns "Method Not Allowed". Maybe this is something that can be opened up but it may be secured for a reason.

I think that this could be useful as well and, unfortunately, I believe that this is the same for most of their API endpoints outside of the hardware.