POST api/Account/CreateUser

Creates a new external user

Exceptions

ExceptionCondition
ArgumentNullHttpResponseException

If you are missing some required arguments

ArgumentOutOfRangeHttpResponseException

Thrown if user name is not a valid email address, if there already exist a user with that logon id, if password is not complex enough or if country is invalid

Examples

Create new use using jQuery ajax call




var arg  = {
    FirstName : "Per",
    LastName : "Nilsen",
    UserName : "per.nilsen@mycompany,no",
    PassWord : "MySecretPassword",
    Country: "no"
 };
 $.ajax({
    url: 'https://api.infocare.com/api/Account/CreateUser',
    data: JSON.stringify(arg),
    type: "POST",
    contentType: "application/json;charset=utf-8"
})
.done (function (){
    //handle success here
})
.fail ( function (jqXHR, textStatus, err){
    //handle failure here
    console.log(jqXHR.status);
    console.log(jqXHR.responseText);
});

Request Information

URI Parameters

None.

Body Parameters

details about the new user

CreateUserArgumentModel
NameDescriptionTypeAdditional information
FirstName

Gets or sets the first name

string

None.

LastName

Gets or sets the last name

string

None.

UserName

Gets or sets the user name, this must be a valid email address

string

None.

Password

Gets or sets the password. The password must be longer that 6 characters and must contain uppercase and lowercase letters and digits.

string

None.

Country

Get or set the country code. The following country codes are supported; no (Norway), se (Sweden), dk (Denmark) and fi (Finland). The country code is used to determine which InfoCare country that is responsible for the user.

string

None.

TicketId

Gets or sets the ticket id

string

None.

Culture

Gets or sets culture, if not specified we will use culture set on user.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "FirstName": "sample string 1",
  "LastName": "sample string 2",
  "UserName": "sample string 3",
  "Password": "sample string 4",
  "Country": "sample string 5",
  "TicketId": "sample string 6",
  "Culture": "sample string 7"
}

application/xml, text/xml

Sample:
<AccountController.CreateUserArgumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Controllers">
  <Culture xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">sample string 7</Culture>
  <TicketId xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">sample string 6</TicketId>
  <Country>sample string 5</Country>
  <FirstName>sample string 1</FirstName>
  <LastName>sample string 2</LastName>
  <Password>sample string 4</Password>
  <UserName>sample string 3</UserName>
</AccountController.CreateUserArgumentModel>

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

Response Information

Resource Description

the user which will be logged in

UserModel
NameDescriptionTypeAdditional information
TicketId

Gets or sets the ticket id. This value is set when user logs on

string

None.

TicketExpirationDate

Gets or sets the ticket expiration date

date

None.

LogonId

Gets or set the logon id

string

None.

DisplayName

Gets or sets the user diaply name

string

None.

SecurityRoles

Gets or sets security roles

Collection of string

None.

CombinedActivityId

If user is SingleActivityUser this property will get the only activity this user can access. This field is only set for SingleActivityUser

string

None.

UserType

Gets or sets the user type, for example PartnerUser, SubContractorUser and so on.

string

None.

UserFields

Gets or sets a list of user updates

Collection of AttributeUpdateModel

None.

DefaultDatabase

Gets or sets default database

string

None.

AvailableDatabases

Gets or sets a list of available databases

Collection of string

None.

SearchableContracts

Gets or sets any contract restrictions set on user when searching for activities. If not set user have no restrictions related to contract and activity search.

Collection of ContractModel

Json null value handling: Ignore

AvailableContracts

Gets or sets any contract restrictions set on user when searching for equipment. If not set user have no restrictions related to creating activities

Collection of ContractModel

Json null value handling: Ignore

AvailableStocks

Gets or sets available stocks

Collection of StockItem

None.

AvailableStockContracts

Gets or sets any stock contract restrictions for partner users.

Collection of ContractModel

None.

MustChangePassword

Gets or sets MustChangePassword

boolean

None.

SearchableBrands

Get or set brand restriction when searching for parts

Collection of string

Json null value handling: Ignore

AvailableBrands

Gets or sets brand restriction when creating activities

Collection of string

Json null value handling: Ignore

AvailableReports

Gets or sets available PowerBI reports

Collection of BIReportModel

Json null value handling: Ignore

DatabaseLogisticConfiguration

Collection of DatabaseItem

Json null value handling: Ignore

CombinedPerformanceId

Gets or sets the performance id. If performance monitoring is not turned on this property will not be present or set to null

string

Json null value handling: Ignore

Response Formats

application/json, text/json

Sample:

Sample not available.