Authentication
1 min
Login
POST
http://{{hostname}}/aioc-rest-web/rest/login
Body Parameters
- usernamestringrequiredDescription
- passwordstringrequiredDescription
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/login");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Cookie", "NETRIGHT_SESSIONID=a1b71fc8-da07-4c0a-b582-c17e03f8fbbf");
request.AddParameter("application/json", "{\"username\":\"admin\",\"password\":\"admin\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location --request POST 'http://{{hostname}}/aioc-rest-web/rest/login' \
--header 'Content-Type: application/json' \
--header 'Cookie: NETRIGHT_SESSIONID=a1b71fc8-da07-4c0a-b582-c17e03f8fbbf' \
--data-raw '{"username":"admin","password":"admin"}'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/login",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({"username":"admin","password":"admin"}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
{
"sessionId": "a1b71fc8-da07-4c0a-b582-c17e03f8fbbf"
}
Logout
POST
http://{{hostname}}/aioc-rest-web/rest/logout
Body Parameters
- idstringrequiredDescription
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/logout");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request POST 'http://{{hostname}}/aioc-rest-web/rest/logout' \
--header 'Content-Type: application/json' \
--data-raw ''javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/logout",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});200