POST api/ProductPhotos

Method to add a new product photo to an existing product

Request Information

URI Parameters

None.

URI Example

api/ProductPhotos

Body Parameters

The product data

Oresto.API.Models.POST.ProductPhotos.ProductPhoto
NameDescriptionTypeAdditional information
LanguageCode

LanguageCode ISO form (three letters) ex. nld or fra. Leave blank for ALL languages.

string

Max length: 3

Min length: 3

Photo

Product photo

Collection of byte

Required

PhotoName

The name of the photo

string

Required

Max length: 100

WholesalerArticleNumber

Article code for the product defined by the wholesaler

string

Primary key field

Required

Max length: 50

Request Formats

application/json, text/json

Sample:
{
  "WholesalerArticleNumber": "sample string 1",
  "LanguageCode": "sample string 2",
  "Photo": "QEA=",
  "PhotoName": "sample string 3"
}

application/xml, text/xml

Sample:
<ProductPhoto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.ProductPhotos">
  <LanguageCode>sample string 2</LanguageCode>
  <Photo>QEA=</Photo>
  <PhotoName>sample string 3</PhotoName>
  <WholesalerArticleNumber>sample string 1</WholesalerArticleNumber>
</ProductPhoto>

application/x-www-form-urlencoded

Sample:
WholesalerArticleNumber=value&LanguageCode=value&Photo=value&PhotoName=value

Response Information

Resource Description

A wrapper class with information about the new entity

Oresto.API.Models.POST.ProductPhotos.ProductPhotoData
NameDescriptionTypeAdditional information
Errors

Possible errors that were experienced when processing the request

Collection of string

None.

ModelStateErrors

Possible model errors that were experienced when validating the data

Collection of Oresto.API.Models.Shared.ModelStateError

None.

RequestInformation

Additional information about the request

Oresto.API.Models.Shared.RequestInformation

None.

Response Formats

application/json, text/json

Sample:
{
  "RequestInformation": {
    "RequestDuration": 1,
    "WholesalerId": 2,
    "UserId": 3
  },
  "ModelStateErrors": [
    {
      "Key": "sample string 1",
      "Message": "sample string 2",
      "Exception": "sample string 3"
    },
    {
      "Key": "sample string 1",
      "Message": "sample string 2",
      "Exception": "sample string 3"
    }
  ],
  "Errors": [
    "sample string 1",
    "sample string 2"
  ]
}

application/xml, text/xml

Sample:
<ProductPhotoData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.ProductPhotos">
  <Errors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Errors>
  <ModelStateErrors xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <ModelStateError>
      <Exception>sample string 3</Exception>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ModelStateError>
    <ModelStateError>
      <Exception>sample string 3</Exception>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ModelStateError>
  </ModelStateErrors>
  <RequestInformation xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.Shared">
    <RequestDuration>1</RequestDuration>
    <UserId>3</UserId>
    <WholesalerId>2</WholesalerId>
  </RequestInformation>
</ProductPhotoData>