POST api/Users

Create a new user

Request Information

URI Parameters

None.

URI Example

api/Users

Body Parameters

User data

Oresto.API.Models.POST.Users.User
NameDescriptionTypeAdditional information
Active

Active or not

boolean

Required

ClientNumber

The number of the client defined by the wholesaler

string

Required

Max length: 50

Email

The e-mail address of the user (Login)

string

Primary key field

Required

Max length: 100

Fax

Fax

string

Max length: 50

Firstname

First name

string

Max length: 50

Image

User image

Collection of byte

None.

ImageName

User image name

string

Max length: 100

LanguageCode

Communication language. ISO form (three letters) ex. nld or fra

string

Required

Max length: 3

Min length: 3

Lastname

Last name

string

Max length: 50

MayViewPrices

May view prices (webshop) - If not defined, MayViewPrices on wholesaler level will be used. If defined may be overruled by MayViewPrices on wholesaler level.

boolean

None.

Password

Password for the login

string

Required

Max length: 2048

Telephone

Telephone

string

Max length: 50

Request Formats

application/json, text/json

Sample:
{
  "Firstname": "sample string 1",
  "Lastname": "sample string 2",
  "Email": "sample string 3",
  "Active": true,
  "LanguageCode": "sample string 5",
  "Telephone": "sample string 6",
  "Fax": "sample string 7",
  "Password": "sample string 8",
  "ClientNumber": "sample string 9",
  "Image": "QEA=",
  "ImageName": "sample string 10",
  "MayViewPrices": true
}

application/xml, text/xml

Sample:
<User xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.Users">
  <Active>true</Active>
  <ClientNumber>sample string 9</ClientNumber>
  <Email>sample string 3</Email>
  <Fax>sample string 7</Fax>
  <Firstname>sample string 1</Firstname>
  <Image>QEA=</Image>
  <ImageName>sample string 10</ImageName>
  <LanguageCode>sample string 5</LanguageCode>
  <Lastname>sample string 2</Lastname>
  <MayViewPrices>true</MayViewPrices>
  <Password>sample string 8</Password>
  <Telephone>sample string 6</Telephone>
</User>

application/x-www-form-urlencoded

Sample:
Firstname=value&Lastname=value&Email=value&Active=value&LanguageCode=value&Telephone=value&Fax=value&Password=value&ClientNumber=value&Image=value&ImageName=value&MayViewPrices=value

Response Information

Resource Description

A wrapper class with info about the entity created

Oresto.API.Models.POST.Users.UserData
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.

UserId

The ID of the newly created user

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "UserId": 1,
  "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:
<UserData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Oresto.API.Models.POST.Users">
  <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>
  <UserId>1</UserId>
</UserData>