POST api/Account/Logon
Logon a user using an existing ticket, use this method to verify that your ticket is still valid.
Exceptions
| Exception | Condition |
|---|---|
| UnauthorizedHttpResponseException |
If ticket is not valid you will get a HttpResponseException with code HttpStatusCode.Unauthorized |
Examples
Login with an existing ticket
function logon (ticketId) {
var arg = {
TicketId : ticket
};
$.ajax({
url: 'https://api.infocare.com/api/Account/Logon',
data: JSON.stringify(arg),
type: "POST",
contentType: "application/json;charset=utf-8"
})
.done(function (result) {
// you should store the ticket id in a localStorage or in a cookie for further reference. In this sample
// we just print it to the console
console.log("logon success, ticket id: " + result.TicketId);
})
.fail(function (jqXHR, textStatus, err) {
console.log("logon failed: " + err);
})
});
Request Information
URI Parameters
None.
Body Parameters
BaseArgumentModel| Name | Description | Type | Additional information |
|---|---|---|---|
| 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
{
"TicketId": "sample string 1",
"Culture": "sample string 2"
}
application/xml, text/xml
<BaseArgumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
<Culture>sample string 2</Culture>
<TicketId>sample string 1</TicketId>
</BaseArgumentModel>
application/x-www-form-urlencoded
Response Information
Resource Description
A UserModel including a valid ticket if user/activity exist and password/security code is correct, otherwise you will get an HttpResponseException()
UserModel| Name | Description | Type | Additional 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 not available.