Skip to main content
PUT
/
user
/
update-password
Update Password
curl --request PUT \
  --url https://apigw.bienport.com/api/user/update-password \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'OrganizationId: <organizationid>' \
  --data '
{
  "oldPassword": "123qweasdzx",
  "password1": "123qweasdzx",
  "password2": "123qweasdzx",
  "userId": 12343123
}
'
import requests

url = "https://apigw.bienport.com/api/user/update-password"

payload = {
    "oldPassword": "123qweasdzx",
    "password1": "123qweasdzx",
    "password2": "123qweasdzx",
    "userId": 12343123
}
headers = {
    "Authorization": "<authorization>",
    "OrganizationId": "<organizationid>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {
    Authorization: '<authorization>',
    OrganizationId: '<organizationid>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    oldPassword: '123qweasdzx',
    password1: '123qweasdzx',
    password2: '123qweasdzx',
    userId: 12343123
  })
};

fetch('https://apigw.bienport.com/api/user/update-password', 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/user/update-password",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'oldPassword' => '123qweasdzx',
    'password1' => '123qweasdzx',
    'password2' => '123qweasdzx',
    'userId' => 12343123
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>",
    "Content-Type: application/json",
    "OrganizationId: <organizationid>"
  ],
]);

$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/user/update-password"

	payload := strings.NewReader("{\n  \"oldPassword\": \"123qweasdzx\",\n  \"password1\": \"123qweasdzx\",\n  \"password2\": \"123qweasdzx\",\n  \"userId\": 12343123\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "<authorization>")
	req.Header.Add("OrganizationId", "<organizationid>")
	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.put("https://apigw.bienport.com/api/user/update-password")
  .header("Authorization", "<authorization>")
  .header("OrganizationId", "<organizationid>")
  .header("Content-Type", "application/json")
  .body("{\n  \"oldPassword\": \"123qweasdzx\",\n  \"password1\": \"123qweasdzx\",\n  \"password2\": \"123qweasdzx\",\n  \"userId\": 12343123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://apigw.bienport.com/api/user/update-password")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["OrganizationId"] = '<organizationid>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"oldPassword\": \"123qweasdzx\",\n  \"password1\": \"123qweasdzx\",\n  \"password2\": \"123qweasdzx\",\n  \"userId\": 12343123\n}"

response = http.request(request)
puts response.read_body
{
  "userId": 123,
  "instanceId": 123,
  "instanceName": "<string>",
  "firstName": "<string>",
  "middleName": "<string>",
  "lastName": "<string>",
  "emailAddressVerified": true,
  "status": 123,
  "nationalId": 123,
  "screenName": "<string>",
  "emailAddress": "<string>",
  "timeZoneId": "<string>",
  "localeId": "<string>",
  "organizations": [
    {
      "name": "<string>",
      "id": 123
    }
  ],
  "organizationIds": [
    123
  ],
  "roles": [
    {
      "roleId": 123,
      "roleName": "<string>",
      "type": 123,
      "inherited": true,
      "typePK": 123,
      "typeName": "<string>"
    }
  ],
  "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.
{
  "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"
}
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"
}

Headers

Authorization
string
required

Access Token

OrganizationId
string
required

Organization ID

Body

application/json

passwordUpdateRequest

Password Update Request Model

oldPassword
string

Old Password

Example:

"123qweasdzx"

password1
string

New Password

Example:

"123qweasdzx"

password2
string

Repeat New Password

Example:

"123qweasdzx"

userId
integer<int64>

User Id

Example:

12343123

Response

User.

User response model

userId
integer<int64>
instanceId
integer<int64>
instanceName
string
firstName
string
middleName
string
lastName
string
emailAddressVerified
boolean
status
integer<int32>
nationalId
integer<int64>
screenName
string
emailAddress
string
timeZoneId
string
localeId
string
organizations
Organization · object[]
organizationIds
integer<int64>[]
roles
RoleResponse · object[]
resources
GetResourceResponse · object[]