createUser
Create a new user
Create a new user in the system. The user will receive a welcome email and will be able to set the password at first login
/users
Usage and SDK Samples
curl -X POST "http://api.fablabs.io/users"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AdminApi;
import java.io.File;
import java.util.*;
public class AdminApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
AdminApi apiInstance = new AdminApi();
Body body = ; // Body | Data for the user to create
try {
apiInstance.createUser(body);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#createUser");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AdminApi;
public class AdminApiExample {
public static void main(String[] args) {
AdminApi apiInstance = new AdminApi();
Body body = ; // Body | Data for the user to create
try {
apiInstance.createUser(body);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#createUser");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
Body *body = ; // Data for the user to create
AdminApi *apiInstance = [[AdminApi alloc] init];
// Create a new user
[apiInstance createUserWith:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var FablabsioApi = require('fablabsio_api');
var defaultClient = FablabsioApi.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = "YOUR ACCESS TOKEN"
var api = new FablabsioApi.AdminApi()
var body = ; // {Body} Data for the user to create
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.createUser(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createUserExample
{
public void main()
{
// Configure OAuth2 access token for authorization: OAuth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new AdminApi();
var body = new Body(); // Body | Data for the user to create
try
{
// Create a new user
apiInstance.createUser(body);
}
catch (Exception e)
{
Debug.Print("Exception when calling AdminApi.createUser: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\Api\AdminApi();
$body = ; // Body | Data for the user to create
try {
$api_instance->createUser($body);
} catch (Exception $e) {
echo 'Exception when calling AdminApi->createUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AdminApi;
# Configure OAuth2 access token for authorization: OAuth2
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::AdminApi->new();
my $body = WWW::SwaggerClient::Object::Body->new(); # Body | Data for the user to create
eval {
$api_instance->createUser(body => $body);
};
if ($@) {
warn "Exception when calling AdminApi->createUser: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: OAuth2
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.AdminApi()
body = # Body | Data for the user to create
try:
# Create a new user
api_instance.create_user(body)
except ApiException as e:
print("Exception when calling AdminApi->createUser: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |