POST api/Food/CreateFoodItemListing

Request Information

URI Parameters

None.

Body Parameters

W_Listing
NameDescriptionTypeAdditional information
FoodID

integer

Required

Matching regular expression pattern: ^[0-9]{1,11}$

ScheduleID

integer

Required

Matching regular expression pattern: ^[0-9]{1,11}$

FoodDays

Collection of Days

Required

StartTime

date

Required

Data type: Time

EndTime

date

Required

Data type: Time

NickName

string

Required

MaxQuantity

integer

Required

Range: inclusive between 10 and 250

LeadTime

integer

Required

Range: inclusive between 0 and 24

DelivaryFee

decimal number

Required

Data type: Currency

Range: inclusive between 0 and 50

ListingPortionPrice

Collection of W_ListItemPrice

None.

DeliverMethod

DeliverMethod

Required

Request Formats

application/json, text/json

Sample:
{
  "foodID": 1,
  "scheduleID": 2,
  "foodDays": [
    "SUNDAY",
    "SUNDAY"
  ],
  "startTime": "2019-07-23T18:05:32.5150584-07:00",
  "endTime": "2019-07-23T18:05:32.5150584-07:00",
  "nickName": "sample string 5",
  "maxQuantity": 6,
  "leadTime": 7,
  "delivaryFee": 8.0,
  "listingPortionPrice": [
    {
      "portionSize": "SMALL",
      "listItemPrice": 1.0
    },
    {
      "portionSize": "SMALL",
      "listItemPrice": 1.0
    }
  ],
  "deliverMethod": "ALL"
}

application/xml, text/xml

Sample:
<W_Listing xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PGDataStructures">
  <DelivaryFee>8</DelivaryFee>
  <DeliverMethod>ALL</DeliverMethod>
  <EndTime>2019-07-23T18:05:32.5150584-07:00</EndTime>
  <FoodDays xmlns:d2p1="http://schemas.datacontract.org/2004/07/System">
    <d2p1:Days>SUNDAY</d2p1:Days>
    <d2p1:Days>SUNDAY</d2p1:Days>
  </FoodDays>
  <FoodID>1</FoodID>
  <LeadTime>7</LeadTime>
  <ListingPortionPrice>
    <W_ListItemPrice>
      <ListItemPrice>1</ListItemPrice>
      <PortionSize>SMALL</PortionSize>
    </W_ListItemPrice>
    <W_ListItemPrice>
      <ListItemPrice>1</ListItemPrice>
      <PortionSize>SMALL</PortionSize>
    </W_ListItemPrice>
  </ListingPortionPrice>
  <MaxQuantity>6</MaxQuantity>
  <NickName>sample string 5</NickName>
  <ScheduleID>2</ScheduleID>
  <StartTime>2019-07-23T18:05:32.5150584-07:00</StartTime>
</W_Listing>

multipart/form-data

Sample:
<W_Listing xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PGDataStructures"><DelivaryFee>8</DelivaryFee><DeliverMethod>ALL</DeliverMethod><EndTime>2019-07-23T18:05:32.5150584-07:00</EndTime><FoodDays xmlns:d2p1="http://schemas.datacontract.org/2004/07/System"><d2p1:Days>SUNDAY</d2p1:Days><d2p1:Days>SUNDAY</d2p1:Days></FoodDays><FoodID>1</FoodID><LeadTime>7</LeadTime><ListingPortionPrice><W_ListItemPrice><ListItemPrice>1</ListItemPrice><PortionSize>SMALL</PortionSize></W_ListItemPrice><W_ListItemPrice><ListItemPrice>1</ListItemPrice><PortionSize>SMALL</PortionSize></W_ListItemPrice></ListingPortionPrice><MaxQuantity>6</MaxQuantity><NickName>sample string 5</NickName><ScheduleID>2</ScheduleID><StartTime>2019-07-23T18:05:32.5150584-07:00</StartTime></W_Listing>

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 'W_Listing'.

Response Information

Resource Description

DBStatusWithLastKey
NameDescriptionTypeAdditional information
LastUpdatedKey

string

None.

Type

DBOperation

None.

Message

Collection of DBMessageType

None.

InnerException

Collection of string

None.

Response Formats

application/json, text/json

Sample:
{
  "lastUpdatedKey": "sample string 1",
  "type": "ERROR",
  "message": [
    "SUCCESSFULLY_DATA_INSERTED",
    "SUCCESSFULLY_DATA_INSERTED"
  ],
  "innerException": [
    "sample string 1",
    "sample string 2"
  ]
}

application/xml, text/xml

Sample:
<DBStatusWithLastKey xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PGDataStructures">
  <InnerException xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </InnerException>
  <Message xmlns:d2p1="http://schemas.datacontract.org/2004/07/DBEnumStructure">
    <d2p1:DBMessageType>SUCCESSFULLY_DATA_INSERTED</d2p1:DBMessageType>
    <d2p1:DBMessageType>SUCCESSFULLY_DATA_INSERTED</d2p1:DBMessageType>
  </Message>
  <Type>ERROR</Type>
  <LastUpdatedKey>sample string 1</LastUpdatedKey>
</DBStatusWithLastKey>

multipart/form-data

Sample:
<DBStatusWithLastKey xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PGDataStructures"><InnerException xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d2p1:string>sample string 1</d2p1:string><d2p1:string>sample string 2</d2p1:string></InnerException><Message xmlns:d2p1="http://schemas.datacontract.org/2004/07/DBEnumStructure"><d2p1:DBMessageType>SUCCESSFULLY_DATA_INSERTED</d2p1:DBMessageType><d2p1:DBMessageType>SUCCESSFULLY_DATA_INSERTED</d2p1:DBMessageType></Message><Type>ERROR</Type><LastUpdatedKey>sample string 1</LastUpdatedKey></DBStatusWithLastKey>