changePassword
Change a user's password
/api/v1/users/{userID}/changepassword
Usage and SDK Samples
curl -X POST \
-H "Authorization: [[apiKey]]" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"http://localhost/api/v1/api/v1/users/{userID}/changepassword" \
-d '{
"oldPassword" : "oldPassword",
"newPassword" : "newPassword"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: BearerAuth
ApiKeyAuth BearerAuth = (ApiKeyAuth) defaultClient.getAuthentication("BearerAuth");
BearerAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//BearerAuth.setApiKeyPrefix("Token");
// Create an instance of the API class
DefaultApi apiInstance = new DefaultApi();
String userID = userID_example; // String | User ID
ChangePasswordRequest body = ; // ChangePasswordRequest |
try {
apiInstance.changePassword(userID, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#changePassword");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String userID = userID_example; // String | User ID
ChangePasswordRequest body = ; // ChangePasswordRequest |
try {
apiInstance.changePassword(userID, body);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#changePassword");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: BearerAuth)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *userID = userID_example; // User ID (default to null)
ChangePasswordRequest *body = ; //
[apiInstance changePasswordWith:userID
body:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var FocalboardServer = require('focalboard_server');
var defaultClient = FocalboardServer.ApiClient.instance;
// Configure API key authorization: BearerAuth
var BearerAuth = defaultClient.authentications['BearerAuth'];
BearerAuth.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//BearerAuth.apiKeyPrefix['Authorization'] = "Token";
// Create an instance of the API class
var api = new FocalboardServer.DefaultApi()
var userID = userID_example; // {String} User ID
var body = ; // {ChangePasswordRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.changePassword(userID, body, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class changePasswordExample
{
public void main()
{
// Configure API key authorization: BearerAuth
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
// Create an instance of the API class
var apiInstance = new DefaultApi();
var userID = userID_example; // String | User ID (default to null)
var body = new ChangePasswordRequest(); // ChangePasswordRequest |
try {
apiInstance.changePassword(userID, body);
} catch (Exception e) {
Debug.Print("Exception when calling DefaultApi.changePassword: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: BearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$userID = userID_example; // String | User ID
$body = ; // ChangePasswordRequest |
try {
$api_instance->changePassword($userID, $body);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->changePassword: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;
# Configure API key authorization: BearerAuth
$WWW::OPenAPIClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $userID = userID_example; # String | User ID
my $body = WWW::OPenAPIClient::Object::ChangePasswordRequest->new(); # ChangePasswordRequest |
eval {
$api_instance->changePassword(userID => $userID, body => $body);
};
if ($@) {
warn "Exception when calling DefaultApi->changePassword: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: BearerAuth
openapi_client.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# openapi_client.configuration.api_key_prefix['Authorization'] = 'Bearer'
# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
userID = userID_example # String | User ID (default to null)
body = # ChangePasswordRequest |
try:
api_instance.change_password(userID, body)
except ApiException as e:
print("Exception when calling DefaultApi->changePassword: %s\n" % e)
extern crate DefaultApi;
pub fn main() {
let userID = userID_example; // String
let body = ; // ChangePasswordRequest
let mut context = DefaultApi::Context::default();
let result = client.changePassword(userID, body, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
userID* |
String
User ID
Required
|
Name | Description |
---|---|
body * |
Change password request |