Authenticate User
curl --request POST \
--url https://apigw.bienport.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"screenName": "905554447788",
"password": "mypass+",
"rememberMe": true
}
'import requests
url = "https://apigw.bienport.com/api/auth/login"
payload = {
"screenName": "905554447788",
"password": "mypass+",
"rememberMe": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({screenName: '905554447788', password: 'mypass+', rememberMe: true})
};
fetch('https://apigw.bienport.com/api/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.bienport.com/api/auth/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'screenName' => '905554447788',
'password' => 'mypass+',
'rememberMe' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.bienport.com/api/auth/login"
payload := strings.NewReader("{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigw.bienport.com/api/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.bienport.com/api/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}"
response = http.request(request)
puts response.read_body{
"token": "Bearer Token",
"mqUser": "messenger",
"mqPassword": "password-here",
"userId": 11234,
"emailAddress": "<string>",
"screenName": "<string>",
"localeId": "<string>",
"roles": [
{
"roleId": 123,
"roleName": "<string>",
"type": 123,
"inherited": true,
"typePK": 123,
"typeName": "<string>"
}
],
"organizations": [
{
"name": "OrganizationName",
"id": "243242"
}
],
"organizationIds": [
30339,
43567
],
"resources": [
{
"resourceId": 123,
"networkId": "<string>",
"resourceName": "<string>",
"enabled": true,
"modelName": "<string>",
"brandName": "<string>",
"treePath": "<string>",
"orgId": 123,
"resourceSensors": [
{
"type": "<string>",
"sensors": [
{
"id": 123,
"resourceId": 123,
"orderNo": 123,
"trueValue": "<string>",
"falseValue": "<string>",
"partitions": [
{
"name": "<string>",
"no": 123
}
],
"sensorId": 123,
"description": "<string>",
"hardwareSerialNumber": "<string>",
"sensorName": "<string>"
}
]
}
],
"resourceControllers": [
{
"hardwareSerialNumber": "<string>",
"id": 123,
"resourceId": 123,
"orderNo": 123,
"trueValue": "<string>",
"falseValue": "<string>",
"description": "<string>",
"controllerName": "<string>",
"controllerId": 123,
"partitions": [
{
"name": "<string>",
"no": 123
}
]
}
],
"resourceSubscriptionId": 123,
"subscriptionDocumentNo": "<string>",
"deviceSubType": "<string>"
}
]
}{}This response has no body data.This response has no body data.{
"statusCode": 123,
"error": "***Exception",
"message": "Message about the error",
"path": "/api/example/path"
}{
"statusCode": 123,
"error": "***Exception",
"message": "Message about the error",
"path": "/api/example/path"
}Authenticate User
POST
/
auth
/
login
Authenticate User
curl --request POST \
--url https://apigw.bienport.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"screenName": "905554447788",
"password": "mypass+",
"rememberMe": true
}
'import requests
url = "https://apigw.bienport.com/api/auth/login"
payload = {
"screenName": "905554447788",
"password": "mypass+",
"rememberMe": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({screenName: '905554447788', password: 'mypass+', rememberMe: true})
};
fetch('https://apigw.bienport.com/api/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.bienport.com/api/auth/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'screenName' => '905554447788',
'password' => 'mypass+',
'rememberMe' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apigw.bienport.com/api/auth/login"
payload := strings.NewReader("{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apigw.bienport.com/api/auth/login")
.header("Content-Type", "application/json")
.body("{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.bienport.com/api/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"screenName\": \"905554447788\",\n \"password\": \"mypass+\",\n \"rememberMe\": true\n}"
response = http.request(request)
puts response.read_body{
"token": "Bearer Token",
"mqUser": "messenger",
"mqPassword": "password-here",
"userId": 11234,
"emailAddress": "<string>",
"screenName": "<string>",
"localeId": "<string>",
"roles": [
{
"roleId": 123,
"roleName": "<string>",
"type": 123,
"inherited": true,
"typePK": 123,
"typeName": "<string>"
}
],
"organizations": [
{
"name": "OrganizationName",
"id": "243242"
}
],
"organizationIds": [
30339,
43567
],
"resources": [
{
"resourceId": 123,
"networkId": "<string>",
"resourceName": "<string>",
"enabled": true,
"modelName": "<string>",
"brandName": "<string>",
"treePath": "<string>",
"orgId": 123,
"resourceSensors": [
{
"type": "<string>",
"sensors": [
{
"id": 123,
"resourceId": 123,
"orderNo": 123,
"trueValue": "<string>",
"falseValue": "<string>",
"partitions": [
{
"name": "<string>",
"no": 123
}
],
"sensorId": 123,
"description": "<string>",
"hardwareSerialNumber": "<string>",
"sensorName": "<string>"
}
]
}
],
"resourceControllers": [
{
"hardwareSerialNumber": "<string>",
"id": 123,
"resourceId": 123,
"orderNo": 123,
"trueValue": "<string>",
"falseValue": "<string>",
"description": "<string>",
"controllerName": "<string>",
"controllerId": 123,
"partitions": [
{
"name": "<string>",
"no": 123
}
]
}
],
"resourceSubscriptionId": 123,
"subscriptionDocumentNo": "<string>",
"deviceSubType": "<string>"
}
]
}{}This response has no body data.This response has no body data.{
"statusCode": 123,
"error": "***Exception",
"message": "Message about the error",
"path": "/api/example/path"
}{
"statusCode": 123,
"error": "***Exception",
"message": "Message about the error",
"path": "/api/example/path"
}Body
application/json
loginRequest
Response
JWT token, user details
Token
Example:
"Bearer Token"
Message Queue User Name
Example:
"messenger"
Message Queue Password
Example:
"password-here"
User Id
Example:
11234
Email Address
Screen Name
Locale
Roles
Show child attributes
Show child attributes
Organization Ids
Show child attributes
Show child attributes
Example:
[ { "name": "OrganizationName", "id": "243242" } ]
Organizations
Example:
[30339, 43567]
Resources
Show child attributes
Show child attributes
Was this page helpful?
⌘I