import 'package:vrchat_dart_generated/api.dart';
All URIs are relative to https://api.vrchat.cloud/api/1
Method | HTTP request | Description |
---|---|---|
checkUserExists | GET /auth/exists | Check User Exists |
deleteUser | PUT /users/{userId}/delete | Delete User |
getCurrentUser | GET /auth/user | Login and/or Get Current User Info |
logout | PUT /logout | Logout |
verify2FA | POST /auth/twofactorauth/totp/verify | Verify 2FA code |
verify2FAEmailCode | POST /auth/twofactorauth/emailotp/verify | Verify 2FA email code |
verifyAuthToken | GET /auth | Verify Auth Token |
verifyRecoveryCode | POST /auth/twofactorauth/otp/verify | Verify 2FA code with Recovery code |
UserExists checkUserExists(email, displayName, username, excludeUserId)
Check User Exists
Checks if a user by a given username
, displayName
or email
exist. This is used during registration to check if a username has already been taken, during change of displayName to check if a displayName is available, and during change of email to check if the email is already used. In the later two cases the excludeUserId
is used to exclude oneself, otherwise the result would always be true. It is REQUIRED to include AT LEAST username
, displayName
or email
query parameter. Although they can be combined - in addition with excludeUserId
(generally to exclude yourself) - to further fine-tune the search.
import 'package:vrchat_dart_generated/api.dart';
final api = VrchatDartGenerated().getAuthenticationApi();
final String email = email_example; // String | Filter by email.
final String displayName = displayName_example; // String | Filter by displayName.
final String username = username_example; // String | Filter by Username.
final String excludeUserId = excludeUserId_example; // String | Exclude by UserID.
try {
final response = api.checkUserExists(email, displayName, username, excludeUserId);
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->checkUserExists: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
String | Filter by email. | [optional] | |
displayName | String | Filter by displayName. | [optional] |
username | String | Filter by Username. | [optional] |
excludeUserId | String | Exclude by UserID. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CurrentUser deleteUser(userId)
Delete User
Deletes the account with given ID. Normal users only have permission to delete their own account. Account deletion is 14 days from this request, and will be cancelled if you do an authenticated request with the account afterwards. VRC+ NOTE: Despite the 14-days cooldown, any VRC+ subscription will be cancelled immediately. METHOD NOTE: Despite this being a Delete action, the method type required is PUT.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
final String userId = userId_example; // String | Must be a valid user ID.
try {
final response = api.deleteUser(userId);
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->deleteUser: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
userId | String | Must be a valid user ID. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CurrentUser getCurrentUser()
Login and/or Get Current User Info
This endpoint does the following two operations: 1) Checks if you are already logged in by looking for a valid auth
cookie. If you are have a valid auth cookie then no additional auth-related actions are taken. If you are not logged in then it will log you in with the Authorization
header and set the auth
cookie. The auth
cookie will only be sent once. 2) If logged in, this function will also return the CurrentUser object containing detailed information about the currently logged in user. The auth string after Authorization: Basic {string}
is a base64-encoded string of the username and password, both individually url-encoded, and then joined with a colon. > base64(urlencode(username):urlencode(password)) WARNING: Session Limit: Each authentication with login credentials counts as a separate session, out of which you have a limited amount. Make sure to save and reuse the auth
cookie if you are often restarting the program. The provided API libraries automatically save cookies during runtime, but does not persist during restart. While it can be fine to use username/password during development, expect in production to very fast run into the rate-limit and be temporarily blocked from making new sessions until older ones expire. The exact number of simultaneous sessions is unknown/undisclosed.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure HTTP basic authorization: authHeader
//defaultApiClient.getAuthentication<HttpBasicAuth>('authHeader').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('authHeader').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: twoFactorAuthCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('twoFactorAuthCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('twoFactorAuthCookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
try {
final response = api.getCurrentUser();
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->getCurrentUser: $e\n');
}
This endpoint does not need any parameter.
authHeader, twoFactorAuthCookie, authCookie
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Success logout()
Logout
Invalidates the login session.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
try {
final response = api.logout();
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->logout: $e\n');
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Verify2FAResult verify2FA(twoFactorAuthCode)
Verify 2FA code
Finishes the login sequence with a normal 2FA-generated code for accounts with 2FA-protection enabled.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
final TwoFactorAuthCode twoFactorAuthCode = ; // TwoFactorAuthCode |
try {
final response = api.verify2FA(twoFactorAuthCode);
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->verify2FA: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
twoFactorAuthCode | TwoFactorAuthCode |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Verify2FAEmailCodeResult verify2FAEmailCode(twoFactorEmailCode)
Verify 2FA email code
Finishes the login sequence with an 2FA email code.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
final TwoFactorEmailCode twoFactorEmailCode = ; // TwoFactorEmailCode |
try {
final response = api.verify2FAEmailCode(twoFactorEmailCode);
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->verify2FAEmailCode: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
twoFactorEmailCode | TwoFactorEmailCode |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
VerifyAuthTokenResult verifyAuthToken()
Verify Auth Token
Verify whether the currently provided Auth Token is valid.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
try {
final response = api.verifyAuthToken();
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->verifyAuthToken: $e\n');
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Verify2FAResult verifyRecoveryCode(twoFactorAuthCode)
Verify 2FA code with Recovery code
Finishes the login sequence with an OTP (One Time Password) recovery code for accounts with 2FA-protection enabled.
import 'package:vrchat_dart_generated/api.dart';
// TODO Configure API key authorization: authCookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('authCookie').apiKeyPrefix = 'Bearer';
final api = VrchatDartGenerated().getAuthenticationApi();
final TwoFactorAuthCode twoFactorAuthCode = ; // TwoFactorAuthCode |
try {
final response = api.verifyRecoveryCode(twoFactorAuthCode);
print(response);
} catch on DioException (e) {
print('Exception when calling AuthenticationApi->verifyRecoveryCode: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
twoFactorAuthCode | TwoFactorAuthCode |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]