Example API

Default

createUser

Create a new user

Create a new user account


/users

Usage and SDK Samples

curl -X POST \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.example.com/v1/users" \
 -d '{
  "name" : "name",
  "avatar" : "https://openapi-generator.tech",
  "email" : "email"
}'
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) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        CreateUserRequest createUserRequest = ; // CreateUserRequest | 

        try {
            User result = apiInstance.createUser(createUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#createUser");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final CreateUserRequest createUserRequest = new CreateUserRequest(); // CreateUserRequest | 

try {
    final result = await api_instance.createUser(createUserRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->createUser: $e\n');
}

import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        CreateUserRequest createUserRequest = ; // CreateUserRequest | 

        try {
            User result = apiInstance.createUser(createUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#createUser");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
CreateUserRequest *createUserRequest = ; // 

// Create a new user
[apiInstance createUserWith:createUserRequest
              completionHandler: ^(User output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var createUserRequest = ; // {CreateUserRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createUser(createUserRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class createUserExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var createUserRequest = new CreateUserRequest(); // CreateUserRequest | 

            try {
                // Create a new user
                User result = apiInstance.createUser(createUserRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.createUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$createUserRequest = ; // CreateUserRequest | 

try {
    $result = $api_instance->createUser($createUserRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->createUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $createUserRequest = WWW::OPenAPIClient::Object::CreateUserRequest->new(); # CreateUserRequest | 

eval {
    my $result = $api_instance->createUser(createUserRequest => $createUserRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->createUser: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
createUserRequest =  # CreateUserRequest | 

try:
    # Create a new user
    api_response = api_instance.create_user(createUserRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->createUser: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let createUserRequest = ; // CreateUserRequest

    let mut context = DefaultApi::Context::default();
    let result = client.createUser(createUserRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Body parameters
Name Description
createUserRequest *

Responses


deleteUser

Delete user

Delete a user account


/users/{id}

Usage and SDK Samples

curl -X DELETE \
 -H "Accept: application/json" \
 "https://api.example.com/v1/users/{id}"
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) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID

        try {
            apiInstance.deleteUser(id);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#deleteUser");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String id = new String(); // String | User ID

try {
    final result = await api_instance.deleteUser(id);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->deleteUser: $e\n');
}

import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID

        try {
            apiInstance.deleteUser(id);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#deleteUser");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *id = id_example; // User ID (default to null)

// Delete user
[apiInstance deleteUserWith:id
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var id = id_example; // {String} User ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteUser(id, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class deleteUserExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var id = id_example;  // String | User ID (default to null)

            try {
                // Delete user
                apiInstance.deleteUser(id);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.deleteUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$id = id_example; // String | User ID

try {
    $api_instance->deleteUser($id);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $id = id_example; # String | User ID

eval {
    $api_instance->deleteUser(id => $id);
};
if ($@) {
    warn "Exception when calling DefaultApi->deleteUser: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
id = id_example # String | User ID (default to null)

try:
    # Delete user
    api_instance.delete_user(id)
except ApiException as e:
    print("Exception when calling DefaultApi->deleteUser: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let id = id_example; // String

    let mut context = DefaultApi::Context::default();
    let result = client.deleteUser(id, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
id*
String
User ID
Required

Responses


getUserById

Get user by ID

Retrieve a specific user by their ID


/users/{id}

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://api.example.com/v1/users/{id}"
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) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID

        try {
            User result = apiInstance.getUserById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getUserById");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String id = new String(); // String | User ID

try {
    final result = await api_instance.getUserById(id);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getUserById: $e\n');
}

import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID

        try {
            User result = apiInstance.getUserById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getUserById");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *id = id_example; // User ID (default to null)

// Get user by ID
[apiInstance getUserByIdWith:id
              completionHandler: ^(User output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var id = id_example; // {String} User ID

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getUserById(id, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getUserByIdExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var id = id_example;  // String | User ID (default to null)

            try {
                // Get user by ID
                User result = apiInstance.getUserById(id);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.getUserById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$id = id_example; // String | User ID

try {
    $result = $api_instance->getUserById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getUserById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $id = id_example; # String | User ID

eval {
    my $result = $api_instance->getUserById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->getUserById: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
id = id_example # String | User ID (default to null)

try:
    # Get user by ID
    api_response = api_instance.get_user_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->getUserById: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let id = id_example; // String

    let mut context = DefaultApi::Context::default();
    let result = client.getUserById(id, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
id*
String
User ID
Required

Responses


getUsers

Get all users

Retrieve a list of all users


/users

Usage and SDK Samples

curl -X GET \
 -H "Accept: application/json" \
 "https://api.example.com/v1/users?page=56&limit=56"
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) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        Integer page = 56; // Integer | Page number
        Integer limit = 56; // Integer | Number of items per page

        try {
            getUsers_200_response result = apiInstance.getUsers(page, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getUsers");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final Integer page = new Integer(); // Integer | Page number
final Integer limit = new Integer(); // Integer | Number of items per page

try {
    final result = await api_instance.getUsers(page, limit);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getUsers: $e\n');
}

import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        Integer page = 56; // Integer | Page number
        Integer limit = 56; // Integer | Number of items per page

        try {
            getUsers_200_response result = apiInstance.getUsers(page, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getUsers");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
Integer *page = 56; // Page number (optional) (default to 1)
Integer *limit = 56; // Number of items per page (optional) (default to 10)

// Get all users
[apiInstance getUsersWith:page
    limit:limit
              completionHandler: ^(getUsers_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var opts = {
  'page': 56, // {Integer} Page number
  'limit': 56 // {Integer} Number of items per page
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getUsers(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getUsersExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var page = 56;  // Integer | Page number (optional)  (default to 1)
            var limit = 56;  // Integer | Number of items per page (optional)  (default to 10)

            try {
                // Get all users
                getUsers_200_response result = apiInstance.getUsers(page, limit);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.getUsers: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$page = 56; // Integer | Page number
$limit = 56; // Integer | Number of items per page

try {
    $result = $api_instance->getUsers($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getUsers: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $page = 56; # Integer | Page number
my $limit = 56; # Integer | Number of items per page

eval {
    my $result = $api_instance->getUsers(page => $page, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->getUsers: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
page = 56 # Integer | Page number (optional) (default to 1)
limit = 56 # Integer | Number of items per page (optional) (default to 10)

try:
    # Get all users
    api_response = api_instance.get_users(page=page, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->getUsers: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let page = 56; // Integer
    let limit = 56; // Integer

    let mut context = DefaultApi::Context::default();
    let result = client.getUsers(page, limit, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Query parameters
Name Description
page
Integer
Page number
limit
Integer
Number of items per page

Responses


updateUser

Update user

Update an existing user


/users/{id}

Usage and SDK Samples

curl -X PUT \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.example.com/v1/users/{id}" \
 -d '{
  "name" : "name",
  "avatar" : "https://openapi-generator.tech",
  "email" : "email"
}'
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) {

        // Create an instance of the API class
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID
        UpdateUserRequest updateUserRequest = ; // UpdateUserRequest | 

        try {
            User result = apiInstance.updateUser(id, updateUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#updateUser");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String id = new String(); // String | User ID
final UpdateUserRequest updateUserRequest = new UpdateUserRequest(); // UpdateUserRequest | 

try {
    final result = await api_instance.updateUser(id, updateUserRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->updateUser: $e\n');
}

import org.openapitools.client.api.DefaultApi;

public class DefaultApiExample {
    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String id = id_example; // String | User ID
        UpdateUserRequest updateUserRequest = ; // UpdateUserRequest | 

        try {
            User result = apiInstance.updateUser(id, updateUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#updateUser");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
String *id = id_example; // User ID (default to null)
UpdateUserRequest *updateUserRequest = ; // 

// Update user
[apiInstance updateUserWith:id
    updateUserRequest:updateUserRequest
              completionHandler: ^(User output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var ExampleApi = require('example_api');

// Create an instance of the API class
var api = new ExampleApi.DefaultApi()
var id = id_example; // {String} User ID
var updateUserRequest = ; // {UpdateUserRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateUser(id, updateUserRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class updateUserExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new DefaultApi();
            var id = id_example;  // String | User ID (default to null)
            var updateUserRequest = new UpdateUserRequest(); // UpdateUserRequest | 

            try {
                // Update user
                User result = apiInstance.updateUser(id, updateUserRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling DefaultApi.updateUser: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$id = id_example; // String | User ID
$updateUserRequest = ; // UpdateUserRequest | 

try {
    $result = $api_instance->updateUser($id, $updateUserRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->updateUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $id = id_example; # String | User ID
my $updateUserRequest = WWW::OPenAPIClient::Object::UpdateUserRequest->new(); # UpdateUserRequest | 

eval {
    my $result = $api_instance->updateUser(id => $id, updateUserRequest => $updateUserRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->updateUser: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
id = id_example # String | User ID (default to null)
updateUserRequest =  # UpdateUserRequest | 

try:
    # Update user
    api_response = api_instance.update_user(id, updateUserRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->updateUser: %s\n" % e)
extern crate DefaultApi;

pub fn main() {
    let id = id_example; // String
    let updateUserRequest = ; // UpdateUserRequest

    let mut context = DefaultApi::Context::default();
    let result = client.updateUser(id, updateUserRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
id*
String
User ID
Required
Body parameters
Name Description
updateUserRequest *

Responses