POST api/AddProduct

Request Information

URI Parameters

None.

Body Parameters

ProductUploadRequest
NameDescriptionTypeAdditional information
Stream

Collection of byte

None.

User

string

None.

UserId

integer

None.

ValidationKey

string

None.

Request Formats

application/json, text/json

Sample:
{
  "stream": "QEA=",
  "user": "sample string 1",
  "userId": 2,
  "validationKey": "sample string 3"
}

application/xml, text/xml

Sample:
<ProductUploadRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Request.Product">
  <User xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Request">sample string 1</User>
  <UserId xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Request">2</UserId>
  <ValidationKey xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Request">sample string 3</ValidationKey>
  <Stream>QEA=</Stream>
</ProductUploadRequest>

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

Response Information

Resource Description

ProductAddResponse
NameDescriptionTypeAdditional information
UpdatedProducts

integer

None.

ErrorProducts

integer

None.

DuplicatedProducts

integer

None.

Quantity

integer

None.

ErrorProductList

Collection of ProductItemErrorResponse

None.

ResultCode

integer

None.

ResultMessage

string

None.

ErrorMessage

string

None.

Response Formats

application/json, text/json

Sample:
{
  "updatedProducts": 1,
  "errorProducts": 2,
  "duplicatedProducts": 3,
  "quantity": 4,
  "errorProductList": [
    {
      "lineNumber": 1,
      "line": "sample string 2",
      "error": "sample string 3",
      "resultCode": 4,
      "resultMessage": "sample string 5",
      "errorMessage": "sample string 6"
    },
    {
      "lineNumber": 1,
      "line": "sample string 2",
      "error": "sample string 3",
      "resultCode": 4,
      "resultMessage": "sample string 5",
      "errorMessage": "sample string 6"
    }
  ],
  "resultCode": 5,
  "resultMessage": "sample string 6",
  "errorMessage": "sample string 7"
}

application/xml, text/xml

Sample:
<ProductAddResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response.Product">
  <ErrorMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 7</ErrorMessage>
  <ResultCode xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">5</ResultCode>
  <ResultMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 6</ResultMessage>
  <DuplicatedProducts>3</DuplicatedProducts>
  <ErrorProductList>
    <ProductItemErrorResponse>
      <ErrorMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 6</ErrorMessage>
      <ResultCode xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">4</ResultCode>
      <ResultMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 5</ResultMessage>
      <Error>sample string 3</Error>
      <Line>sample string 2</Line>
      <LineNumber>1</LineNumber>
    </ProductItemErrorResponse>
    <ProductItemErrorResponse>
      <ErrorMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 6</ErrorMessage>
      <ResultCode xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">4</ResultCode>
      <ResultMessage xmlns="http://schemas.datacontract.org/2004/07/SGAMovil.Response">sample string 5</ResultMessage>
      <Error>sample string 3</Error>
      <Line>sample string 2</Line>
      <LineNumber>1</LineNumber>
    </ProductItemErrorResponse>
  </ErrorProductList>
  <ErrorProducts>2</ErrorProducts>
  <Quantity>4</Quantity>
  <UpdatedProducts>1</UpdatedProducts>
</ProductAddResponse>