PinTypes
GET /pins/types
Lấy danh sách loại ghim Quyền: pin.type.view_list
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_name | YES |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"_embedded": {
"pin_types": [
{
"type_uuid",
"type_name",
},...
]
}
}
POST /pins/types
Thêm loại ghim mới Quyền: pin.type.add
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_name | YES |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.pins.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"type_name"
}
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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{result: "SUCCESS | ERROR"}
PUT /pins/types[/:type_uuid]
Sửa tên loại ghim Quyền: pin.type.edit
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_name | YES |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.pins.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"type_name"
}
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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{result: "ERROR | SUCCESS"}
Lỗi:
- NOT_FOUND_PIN_TYPE: Không tìm thấy loại ghim
- ERROR: Lỗi lưu trữ
DELETE /pins/types[/:type_uuid]
Xóa loại ghim Quyền: pin.type.delete
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_name | YES |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Pins
GET /pins/pins
Lấy danh sách sản phẩm ghim theo người dùng.
+ Param: type_uuid, reference, product_name, start_date (Ngày ghim), end_date, person_id (person share)
+ Order: type_name, reference, product_name, pin_date, note, person_share
Quyền: pin.pin.view_list
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_uuid | NO | ||
| product_id | NO | ||
| person_share | NO | ||
| action | NO | ||
| share_note | NO | ||
| hold_pin | NO | ||
| note | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{
"_embedded": {
"pins": [
{
"pin_uuid",
"type_uuid",
"type_name", //Loại ghim
"product_id",
"reference",
"product_name",
"pin_date", //Ngày ghim
"note",
"person_share", //Tên người share
"share_date" //Ngày share
}
]
},
}
POST /pins/pins
Thêm sản phẩm ghim; Quyền: pin.pin.add
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_uuid | NO | ||
| product_id | NO | ||
| person_share | NO | ||
| action | NO | ||
| share_note | NO | ||
| hold_pin | NO | ||
| note | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.pins.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"product_id", //required
}
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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{"result": "ERROR | SUCCESS"}
Các lỗi:
- EXIST_PRODUCT_PIN: Đã tồn tại ghim với SP này (phân biệt bởi type_uuid, product_id, person_share)
PUT /pins/pins[/:pins_id]
- Chỉnh sửa loại ghim. Quyền: pin.pin.edit_type;
- Chỉnh sửa ghi chú. Quyền: pin.pin.edit_note;
- Chuyển tiếp ghim. Quyền: pin.pin.forward;
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_uuid | NO | ||
| product_id | NO | ||
| person_share | NO | ||
| action | NO | ||
| share_note | NO | ||
| hold_pin | NO | ||
| note | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.v1+json
application/hal+json
application/json |
| Content-Type | application/vnd.pins.v1+json
application/json |
| Authorization | HTTP Basic, HTTP Digest, or OAuth2 Bearer token (check API provider for details) |
Body
{
"action": "editType | editNote | forwardPin",
"type_uuid", // Với action editType. Not required
"note", //Với action editNote. Not required
"person_share", //Với action forwardPin. Required. Id người share
"share_note": "Y|N", //Với action forwardPin. Required. Có share ghi chú không
"hold_pin": "Y|N" //Với action forwardPin. Required. Có giữ lại SP ghim khi chuyển tiếp không
}
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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |
Body
{"result": "ERROR | SUCCESS"}
Các lỗi:
- Lỗi chung:
+ ERROR: Lỗi lưu trữ
- editType:
+ EXIST_PRODUCT_PIN: Đã tồn tại ghim với SP này (phân biệt bởi type_uuid, product_id, person_share)
- forwardPin:
+ NOT_FORWARD_FOR_SELF: Không forward cho chính mình
+ NOT_FOUND_PERSON_FORWARD: Không tìm thấy người chuyển tiếp
+ EXIST_PRODUCT_PIN: Đã share ghim này cho người này
DELETE /pins/pins[/:pins_id]
Xóa ghim. Quyền: pin.pin.delete. Lỗi xảy ra: NOT_FOUND_PIN, ERROR
Fields
| Field | Type | Description | Required |
|---|---|---|---|
| type_uuid | NO | ||
| product_id | NO | ||
| person_share | NO | ||
| action | NO | ||
| share_note | NO | ||
| hold_pin | NO | ||
| note | NO |
Request
Headers
| Header | Value |
|---|---|
| Accept | application/vnd.pins.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.pins.v1+json
application/hal+json
application/json |
| Allow | Comma-separated list of all HTTP methods allowed |