Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
13 views8 pages

API Design

Uploaded by

Đồng Thúy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views8 pages

API Design

Uploaded by

Đồng Thúy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Base URL: https://develop.snipeitapp.

com/api/v1/
Path locations
Method Post
Authorization: Bearer {{token}}
Headers accept: application/json

Body format json


Parameter Required Type
name yes String
address no String
address2 no String
city no String
state no String
country no String
zip no String
ldap_ou no String
parent_id no Int32
currency no String
manager_id no Int32

Sample
{
"name": "123",
"address": "ha noi",
"address2": "test",
"city": "hanoi",
"state": "ha noi",
"country": "viet nam",
"zip": "10001",
"currency": "vnd",
"manager_id": "1",
"parent_id": "1"
}
Respond
Case Code
Invalid token 401

name blank 200


name not unique 200

manager_id not exist 200

All valid 200


Explaine
Name of the location
Address line 1 of location
Address line 2 of location
City of location
State of location
Country of location
Zip code of location
ldap option
The id of location which is father of the location
Currency that use for location
UserID that manages the location

Body content
"error": "Unauthorized or unauthenticated."

"status": "error",
"messages": {
"name": [
"The name field is required."
]
},
"payload": null
}
"accessories_count": 0,
"consumables_count": 0,
"company": null,
"created_by": null,
"created_at": {
"datetime": "2023-05-22 16:58:46",
"formatted": "2023-05-22 04:58 PM"
"status":
}, "error",
"messages": {
"updated_at": {
"name": [
"datetime": "2023-06-24 02:44:42",
"The name must"2023-06-24
"formatted": be unique."02:44 AM"
] },
}, "start_date": null,
"payload": null null,
"end_date":
"last_login": {
"datetime": "2023-06-24 02:44:42",
"status":"formatted":
"error", "2023-06-24 02:44 AM"
"messages":
}, {
"manager_id":
"deleted_at":[ null,
"The selected manager
"available_actions": { id is invalid."
] "update": true,
}, "delete": true,
"payload": null true,
"clone":
"restore": false
},
"groups": null
},
"children": [],
"available_actions": {
"update": true,
"delete": true
}
}
Base URL: https://develop.snipeitapp.com/api/v1/
Path locations
Parameter ?limit=50&offset=0&sort=created_at
Method GET
Authorization: Bearer {{token}}
Headers accept: application/json

Respond Case Code


Invalid token 401
Limit invalid/missing 200
Body content
"error": "Unauthorized or unauthenticated."
List all locations
Base URL: https://develop.snipeitapp.com/api/v1/
Path locations
Parameter /{id}
Method GET
Authorization: Bearer {{token}}
Headers accept: application/json

Respond Case Code


Invalid token 401

Location not found 200

Valid location 200


"created_by": null,
"created_at": {
"datetime": "2023-05-22 16:58:46",
"formatted": "2023-05-22 04:58 PM"
},
"updated_at": {
"datetime": "2023-06-24 02:44:42",
"formatted": "2023-06-24 02:44 AM"
},
"start_date": null,
"end_date": null,
"last_login": {
"datetime": "2023-06-24 02:44:42",
"formatted": "2023-06-24 02:44 AM"
},
"deleted_at": null,
"available_actions": {
"update": true,
Body content
"delete": true,
"error":"clone":
"Unauthorized
true, or unauthenticated."
"restore": false
"status":
}, "error",
"messages": "Location not found",
"groups": null
"payload":
}, null
"children": [],
"available_actions": {
"update": true,
"delete": true
}

You might also like