POST api/donation

Post new Product to the system

Request Information

URI Parameters

None.

Body Parameters

Donation want to post

YSHDonationDTO
NameDescriptionTypeAdditional information
donation_uid

ID of the product

integer

None.

product_name

Name of the product

string

None.

donator_uid

User ID of the seller

integer

None.

donator_display_name

Name of the seller

string

None.

category_uid

Category Id of the product

integer

None.

category_name

Category Name of the product

string

None.

current_state_uid

Current State of the product

integer

None.

product_desc

Description of the produdct

string

None.

image_1_uid

URL of image 1 of product

integer

None.

image_2_uid

URL of image 2 of product

integer

None.

image_3_uid

URL of image 3 of product

integer

None.

image_1_path

URL of image 1 of product

string

None.

image_2_path

URL of image 2 of product

string

None.

image_3_path

URL of image 3 of product

string

None.

contact_name

Contact person name

string

None.

contact_phone

Contact person phone

string

None.

donation_create_date

Create Date of the Product

date

None.

Request Formats

application/json, text/json

Sample:
{
  "donation_uid": 1,
  "product_name": "sample string 2",
  "donator_uid": 3,
  "donator_display_name": "sample string 4",
  "category_uid": 5,
  "category_name": "sample string 6",
  "current_state_uid": 7,
  "product_desc": "sample string 8",
  "image_1_uid": 1,
  "image_2_uid": 1,
  "image_3_uid": 1,
  "image_1_path": "sample string 9",
  "image_2_path": "sample string 10",
  "image_3_path": "sample string 11",
  "contact_name": "sample string 12",
  "contact_phone": "sample string 13",
  "donation_create_date": "2018-01-22T21:22:28.0324908+08:00"
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'YSHDonationDTO'.

Response Information

Resource Description

Message with API result, if sucess(200), product info like user UID will return; if fail in input, error message with missing field(400) will return; if user is not valid or credit not enough, error message will returen with reason(400)

NewProductResponse
NameDescriptionTypeAdditional information
Message

Message of the API

string

None.

Product

Product info

Product Simple Info

None.

Response Formats

application/json, text/json

Sample:
{
  "Message": "sample string 1",
  "Product": {
    "uid": 1,
    "name": "sample string 2"
  }
}