Skip to content

Latest commit

 

History

History
167 lines (154 loc) · 4.55 KB

API.md

File metadata and controls

167 lines (154 loc) · 4.55 KB

API

API Key: wkvtE45Rg9tEm8rSD4uZt8m0DygNydJoDE8Q6vwq für das Team "Hey, Alter - Teststadt"

Show all computers of current team

curl --location 'https://heyneuer.com/api/computers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx

Show single computer with id 1

curl --location 'https://heyneuer.com/api/computers/1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx'

Show sinlge computer by number HA-E-0001

curl --location 'https://heyneuer.com/api/computers/HA-E-0001' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx'

Create computer with autogenerated number

curl --location 'https://heyneuer.com/api/computers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--data-raw '{
    "donor": "Max Mustermann",
    "email": "[email protected]",
    "type": "4",
    "model": "Dell...",
    "memory_in_gb": 4,
    "hard_drive_type": 2,
    "hard_drive_space_in_gb": 250,
    "has_vga_videoport": 0,
    "has_dvi_videoport": 0,
    "has_hdmi_videoport": 0,
    "has_displayport_videoport": 0,
    "cpu": "",
    "has_webcam": 0,
    "has_wlan": 0,
    "required_equipment": "",
    "is_deletion_required": 0,
    "needs_donation_receipt": 0,
    "state": "in_progress",
    "comment": ""
}'

Create computer with number HA-E-0001

curl --location 'https://heyneuer.com/api/computers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--data-raw '{
    "number": 1
    "donor": "Max Mustermann",
    "email": "[email protected]",
    "type": "4",
    "model": "Dell...",
    "memory_in_gb": 4,
    "hard_drive_type": 2,
    "hard_drive_space_in_gb": 250,
    "has_vga_videoport": 0,
    "has_dvi_videoport": 0,
    "has_hdmi_videoport": 0,
    "has_displayport_videoport": 0,
    "cpu": "",
    "has_webcam": 0,
    "has_wlan": 0,
    "required_equipment": "",
    "is_deletion_required": 0,
    "needs_donation_receipt": 0,
    "state": "in_progress",
    "comment": ""
}'

Update existing computer with id 1

curl --location --request PATCH 'https://heyneuer.com/api/computers/1' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--data-raw '{
    "donor": "Max Mustermann",
    "email": "[email protected]",
    "type": "2",
    "model": "Dell...",
    "memory_in_gb": 4,
    "hard_drive_type": 2,
    "hard_drive_space_in_gb": 250,
    "has_vga_videoport": 0,
    "has_dvi_videoport": 0,
    "has_hdmi_videoport": 0,
    "has_displayport_videoport": 0,
    "cpu": "",
    "has_webcam": 0,
    "has_wlan": 0,
    "required_equipment": "",
    "is_deletion_required": 0,
    "needs_donation_receipt": 0,
    "state": "new",
    "comment": "new"
}'

Update existing computer with number HA-E-0001

curl --location --request PATCH 'https://heyneuer.com/api/computers/HA-E-0001' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--data-raw '{
    "donor": "Max Mustermann!",
    "email": "[email protected]",
    "type": "2",
    "model": "Dell...",
    "memory_in_gb": 4,
    "hard_drive_type": 2,
    "hard_drive_space_in_gb": 250,
    "has_vga_videoport": 0,
    "has_dvi_videoport": 0,
    "has_hdmi_videoport": 0,
    "has_displayport_videoport": 0,
    "cpu": "",
    "has_webcam": 0,
    "has_wlan": 0,
    "required_equipment": "",
    "is_deletion_required": 0,
    "needs_donation_receipt": 0,
    "state": "new",
    "comment": "new"
}'

Delete computer with id 1

curl --location --request DELETE 'https://heyneuer.com/api/computers/HA-E-0001' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "id": 1
}'

Delete computer with number HA-E-0001

curl --location --request DELETE 'https://heyneuer.com/api/computers/HA-E-0001' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer xxx' \

type

1 (Desktop), 2 (Laptop), 3 (Tablett), 4 (Small Form Factor)

state

new, in_progress, refurbished, picked, delivered, destroyed, loss