Locations
GET /locations
- Lấy danh sách location. Truyền param active=Y để lọc theo location active Lấy danh sách location theo person: Truyền param by_person = Y
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| name | NO | ||
| address | NO | ||
| isactive | NO | ||
| isprimary | NO | ||
| config | NO | ||
| action | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.locations.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.locations.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"_embedded": {
"locations": [
{
"location_id",
"location_name",
"isactive": "Y|N",
},
]
}
}
POST /locations
Thêm mới location
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| name | NO | ||
| address | NO | ||
| isactive | NO | ||
| isprimary | NO | ||
| config | NO | ||
| action | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.locations.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.locations.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"name",
"address",
"isactive": "Y|N",
"isprimary": "Y|N",
"config" //string JSON
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.locations.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
//Các lỗi có thể xảy ra - EXIST_NAME: Tên location đã tồn tại - ERROR: Lỗi khác
GET /locations[/:location_id]
Lấy thông tin location
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| name | NO | ||
| address | NO | ||
| isactive | NO | ||
| isprimary | NO | ||
| config | NO | ||
| action | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.locations.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.locations.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"result": "SUCCESS",
"location": {
"location_id",
"location_name",
"address",
"isactive": "Y|N",
"isprimary": "Y|N",
"config": null | array_config
}
}
//ERROR
- NOT_FOUND_LOCATION: Không tìm thấy location
PUT /locations[/:location_id]
Chỉnh sửa thông tin kho
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| name | NO | ||
| address | NO | ||
| isactive | NO | ||
| isprimary | NO | ||
| config | NO | ||
| action | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.locations.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.locations.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"action": "editName | editAddress | editActive | editPrimary | editConfig",
"name", //require by action editName
"address", //require by action editAddress
"isactive", //require by action editActive
"isprimary", //require by action editPrimary
"config" //require by action editConfig
}
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.locations.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
Các lỗi có thẻ xảy ra: - NOT_FOUND_LOCATION: Không tìm thấy location - ERROR: Lỗi khác. - EXIST_NAME: Tên kho đã tồn tại. //action editName
DELETE /locations[/:location_id]
Xóa kho. Các lỗi có thể xảy ra: - NOT_FOUND_LOCATION: Không tìm thấy kho; - ERROR: Lỗi khác
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| name | NO | ||
| address | NO | ||
| isactive | NO | ||
| isprimary | NO | ||
| config | NO | ||
| action | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.locations.v1+json
application/hal+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 204: No Content
- 404: Not Found
- 401: Unauthorized
- 403: Forbidden
Headers
| Header | Value |
|---|---|
| Content-Type | application/vnd.locations.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |