UserService Class |
All methods need a format as input (json/xml) - result of request is delivered on format selected.
Namespace: OfvVehicleData.Service
public class UserService
The UserService type exposes the following members.
| Name | Description | |
|---|---|---|
| UserService | Initializes a new instance of the UserService class |
| Name | Description | |
|---|---|---|
| ChangePassword |
Password update for registered user.
| |
| Login |
Login user.
| |
| Reset |
Password reset for registered user.
|
Below is a simple example, that shows how to call the service "Login" from javascript using jquery:
function runLogin() {
var dateTest;
var userObject = { "username": "your username", "password": "your password - MD5 format", "ipAddress":"your ip address" };
var url = "https://www.kjoretoydata.no/UserAdmin/Login?format=json";
var input = { "user": userObject };
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(input),
processData: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) { alert('Result: ' + response); }
, error: function (request, status, error) { alert('Error:' + request.status + ',' + request.statusText + ',' + request.responseText); }
});
}Data in (json-format):
{
"user" : {
"username" : "my@email.com",
"password" : "f826b0f076ec196ee4df340661baaef4",
"ipAddress" : "192.168.1.254"
}
}Data out (json-format):
{
"success" : true,
"data" : {
"__type" : "user:login",
"id" : 100,
"nm" : "Will Hunting",
"username" : "my@email.com",
"fname" : "Will",
"lname" : "Hunting",
"email" : "my@email.com",
"address" : {
"street1" : "Equation road 123",
"street2" : "",
"zip" : "1111",
"city" : "Eureka",
"country" : "Norge"
},
"token" : "268afe0108e7e63054be604d7dbd7c62",
"company" : {
"id" : 1000,
"nm" : "MIT AS",
"email" : "post@company.com",
"orgno" : "987654321",
"address" : {
"street1" : "Equation road 314",
"street2" : "",
"zip" : "1111",
"city" : "Eureka",
"country" : "Norge"
},
"postalAddress" : {
"street1" : "P.O. 1111",
"zip" : "1111",
"city" : "Eureka",
"country" : "Norge"
},
"phone" : "+4712345678",
"fax" : "",
"contactPerson" : "Rainman",
"active" : true,
"comments" : ""
},
"modLs" : [],
"subLs" : [{
"id" : 8,
"nm" : "Kjøretøydata Proff - Personbil",
"vhg" : [{
"id" : 101,
"nm" : "Personbil"
}
],
"modLs" : [{
"id" : 1,
"nm" : "Fritekst søk",
"wsId" : 1
}, {
"id" : 2,
"nm" : "Merke\/modell søk",
"wsId" : 2
}, {
"id" : 3,
"nm" : "Kjøretøy spesifikasjoner",
"wsId" : 3
}, {
"id" : 4,
"nm" : "Søkefilter",
"wsId" : 8
}, {
"id" : 5,
"nm" : "Filter søk",
"wsId" : 5
}, {
"id" : 8,
"nm" : "Eksport søkeresultat til PDF",
"wsId" : 7
}, {
"id" : 13,
"nm" : "Eksport filtersøk til CVS",
"wsId" : 9
}, {
"id" : 14,
"nm" : "Avgiftsberegning",
"wsId" : 10
}, {
"id" : 15,
"nm" : "Kjøretøy mal",
"wsId" : 11
}, {
"id" : 6,
"nm" : "Sammenligning",
"wsId" : 4
}, {
"id" : 100,
"nm" : "Min side - Filtersøk",
"wsId" : 100
}, {
"id" : 101,
"nm" : "Min side - Varsling",
"wsId" : 101
}, {
"id" : 102,
"nm" : "Min side - Sammenlikning",
"wsId" : 102
}, {
"id" : 103,
"nm" : "Min side - Dummy",
"wsId" : 103
}, {
"id" : 16,
"nm" : "Eksport sammenligning til CSV",
"wsId" : 12
}
]
}, {
"id" : 10,
"nm" : "Kjøretøydata Proff - Varebil",
"vhg" : [{
"id" : 311,
"nm" : "Varebil"
}
],
"modLs" : [{
"id" : 1,
"nm" : "Fritekst søk",
"wsId" : 1
}, {
"id" : 2,
"nm" : "Merke\/modell søk",
"wsId" : 2
}, {
"id" : 3,
"nm" : "Kjøretøy spesifikasjoner",
"wsId" : 3
}, {
"id" : 4,
"nm" : "Søkefilter",
"wsId" : 8
}, {
"id" : 5,
"nm" : "Filter søk",
"wsId" : 5
}, {
"id" : 6,
"nm" : "Sammenligning",
"wsId" : 4
}, {
"id" : 8,
"nm" : "Eksport søkeresultat til PDF",
"wsId" : 7
}, {
"id" : 13,
"nm" : "Eksport filtersøk til CVS",
"wsId" : 9
}, {
"id" : 14,
"nm" : "Avgiftsberegning",
"wsId" : 10
}, {
"id" : 15,
"nm" : "Kjøretøy mal",
"wsId" : 11
}, {
"id" : 100,
"nm" : "Min side - Filtersøk",
"wsId" : 100
}, {
"id" : 101,
"nm" : "Min side - Varsling",
"wsId" : 101
}, {
"id" : 102,
"nm" : "Min side - Sammenlikning",
"wsId" : 102
}, {
"id" : 103,
"nm" : "Min side - Dummy",
"wsId" : 103
}, {
"id" : 16,
"nm" : "Eksport sammenligning til CSV",
"wsId" : 12
}
]
}, {
"id" : 11,
"nm" : "Kjøretøydata Proff - MC",
"vhg" : [{
"id" : 610,
"nm" : "Lett MC"
}, {
"id" : 620,
"nm" : "Tung MC"
}
],
"modLs" : [{
"id" : 1,
"nm" : "Fritekst søk",
"wsId" : 1
}, {
"id" : 2,
"nm" : "Merke\/modell søk",
"wsId" : 2
}, {
"id" : 3,
"nm" : "Kjøretøy spesifikasjoner",
"wsId" : 3
}, {
"id" : 4,
"nm" : "Søkefilter",
"wsId" : 8
}, {
"id" : 5,
"nm" : "Filter søk",
"wsId" : 5
}, {
"id" : 6,
"nm" : "Sammenligning",
"wsId" : 4
}, {
"id" : 8,
"nm" : "Eksport søkeresultat til PDF",
"wsId" : 7
}, {
"id" : 13,
"nm" : "Eksport filtersøk til CVS",
"wsId" : 9
}, {
"id" : 14,
"nm" : "Avgiftsberegning",
"wsId" : 10
}, {
"id" : 15,
"nm" : "Kjøretøy mal",
"wsId" : 11
}, {
"id" : 100,
"nm" : "Min side - Filtersøk",
"wsId" : 100
}, {
"id" : 101,
"nm" : "Min side - Varsling",
"wsId" : 101
}, {
"id" : 102,
"nm" : "Min side - Sammenlikning",
"wsId" : 102
}, {
"id" : 103,
"nm" : "Min side - Dummy",
"wsId" : 103
}, {
"id" : 16,
"nm" : "Eksport sammenligning til CSV",
"wsId" : 12
}
]
}
],
"phone" : "+4787654321",
"active" : true,
"comments" : "",
"lastLoginTime" : 1342545280477,
"role" : {
"id" : 1,
"nm" : "Admin",
"description" : "Administrator rolle som kan tilføje fjerne bedrifter, personer, abonnement og roller."
},
"ipAddress" : "192.168.1.254"
}
}