getCurrentUser
Gets currentl logged in user based on authentication
/users/me
Usage and SDK Samples
curl -X GET "https://localhost/inventory-service/api/v1/users/me"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.UserApi;
import java.io.File;
import java.util.*;
public class UserApiExample {
public static void main(String[] args) {
UserApi apiInstance = new UserApi();
try {
User result = apiInstance.getCurrentUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#getCurrentUser");
e.printStackTrace();
}
}
}
import io.swagger.client.api.UserApi;
public class UserApiExample {
public static void main(String[] args) {
UserApi apiInstance = new UserApi();
try {
User result = apiInstance.getCurrentUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#getCurrentUser");
e.printStackTrace();
}
}
}
UserApi *apiInstance = [[UserApi alloc] init];
// Gets currentl logged in user based on authentication
[apiInstance getCurrentUserWithCompletionHandler:
^(User output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SiemensInventoryRestApi = require('siemens_inventory_rest_api');
var api = new SiemensInventoryRestApi.UserApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getCurrentUser(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getCurrentUserExample
{
public void main()
{
var apiInstance = new UserApi();
try
{
// Gets currentl logged in user based on authentication
User result = apiInstance.getCurrentUser();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling UserApi.getCurrentUser: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\UserApi();
try {
$result = $api_instance->getCurrentUser();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::UserApi;
my $api_instance = WWW::SwaggerClient::UserApi->new();
eval {
my $result = $api_instance->getCurrentUser();
print Dumper($result);
};
if ($@) {
warn "Exception when calling UserApi->getCurrentUser: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.UserApi()
try:
# Gets currentl logged in user based on authentication
api_response = api_instance.get_current_user()
pprint(api_response)
except ApiException as e:
print("Exception when calling UserApi->getCurrentUser: %s\n" % e)