All URIs are relative to https://api.vultr.com/v2
Method | HTTP request | Description |
---|---|---|
CreateUser | POST /users | Create User |
DeleteUser | DELETE /users/{user-id} | Delete User |
GetUser | GET /users/{user-id} | Get User |
ListUsers | GET /users | Get Users |
UpdateUser | PATCH /users/{user-id} | Update User |
User CreateUser (CreateUserRequest? createUserRequest = null)
Create User
Create a new User. The email
, name
, and password
attributes are required.
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class CreateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.vultr.com/v2";
// Configure Bearer token for authorization: API Key
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new UsersApi(config);
var createUserRequest = new CreateUserRequest?(); // CreateUserRequest? | Include a JSON object in the request body with a content type of **application/json**. (optional)
try
{
// Create User
User result = apiInstance.CreateUser(createUserRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.CreateUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Create User
ApiResponse<User> response = apiInstance.CreateUserWithHttpInfo(createUserRequest);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.CreateUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
createUserRequest | CreateUserRequest? | Include a JSON object in the request body with a content type of application/json. | [optional] |
[API Key](../README.md#API Key)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteUser (string userId)
Delete User
Delete a User.
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class DeleteUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.vultr.com/v2";
// Configure Bearer token for authorization: API Key
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new UsersApi(config);
var userId = "userId_example"; // string | The [User id](#operation/list-users).
try
{
// Delete User
apiInstance.DeleteUser(userId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.DeleteUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete User
apiInstance.DeleteUserWithHttpInfo(userId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.DeleteUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | The User id. |
void (empty response body)
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User GetUser (string userId)
Get User
Get information about a User.
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class GetUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.vultr.com/v2";
// Configure Bearer token for authorization: API Key
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new UsersApi(config);
var userId = "userId_example"; // string | The [User id](#operation/list-users).
try
{
// Get User
User result = apiInstance.GetUser(userId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.GetUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get User
ApiResponse<User> response = apiInstance.GetUserWithHttpInfo(userId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.GetUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | The User id. |
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
401 | Unauthorized | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUsers200Response ListUsers (decimal? perPage = null, string? cursor = null)
Get Users
Get a list of all Users in your account.
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class ListUsersExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.vultr.com/v2";
// Configure Bearer token for authorization: API Key
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new UsersApi(config);
var perPage = 8.14D; // decimal? | Number of items requested per page. Default is 100 and Max is 500. (optional)
var cursor = "cursor_example"; // string? | Cursor for paging. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination). (optional)
try
{
// Get Users
ListUsers200Response result = apiInstance.ListUsers(perPage, cursor);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.ListUsers: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get Users
ApiResponse<ListUsers200Response> response = apiInstance.ListUsersWithHttpInfo(perPage, cursor);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.ListUsersWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
perPage | decimal? | Number of items requested per page. Default is 100 and Max is 500. | [optional] |
cursor | string? | Cursor for paging. See Meta and Pagination. | [optional] |
[API Key](../README.md#API Key)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request | - |
401 | Unauthorized | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UpdateUser (string userId, UpdateUserRequest? updateUserRequest = null)
Update User
Update information for a User. All attributes are optional. If not set, the attributes will retain their original values.
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class UpdateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.vultr.com/v2";
// Configure Bearer token for authorization: API Key
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new UsersApi(config);
var userId = "userId_example"; // string | The [User id](#operation/list-users).
var updateUserRequest = new UpdateUserRequest?(); // UpdateUserRequest? | Include a JSON object in the request body with a content type of **application/json**. (optional)
try
{
// Update User
apiInstance.UpdateUser(userId, updateUserRequest);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.UpdateUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Update User
apiInstance.UpdateUserWithHttpInfo(userId, updateUserRequest);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UsersApi.UpdateUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | The User id. | |
updateUserRequest | UpdateUserRequest? | Include a JSON object in the request body with a content type of application/json. | [optional] |
void (empty response body)
[API Key](../README.md#API Key)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]