Login
1 min
POST
{{url}}/aioc-rest-web/rest/login
Path Parameters
- urlstringDefaulturl
Header Parameters
- Content-TypestringDefaultapplication/json
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{"username":"{{TestUserName}}","password":"{{TestUserPassword}}"}
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/login \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\"username\":\"{{TestUserName}}\",\"password\":\"{{TestUserPassword}}\"}"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-xsrf-token", "{{csrftoken}}");
var raw = JSON.stringify("{\"username\":\"{{TestUserName}}\",\"password\":\"{{TestUserPassword}}\"}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/login", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("{{url}}/aioc-rest-web/rest/login")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-xsrf-token"] = "{{csrftoken}}"
request.body = JSON.dump("{\"username\":\"{{TestUserName}}\",\"password\":\"{{TestUserPassword}}\"}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/login"
payload = json.dumps("{\"username\":\"{{TestUserName}}\",\"password\":\"{{TestUserPassword}}\"}")
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-xsrf-token': '{{csrftoken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
{
"sessionId": "a8aa28c1-bd5a-4ea3-9490-47cfee4b52ca"
}