|
| 1 | +# PermissionsApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.vrchat.cloud/api/1* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**getAssignedPermissions**](PermissionsApi.md#getAssignedPermissions) | **GET** /auth/permissions | Get Assigned Permission |
| 8 | +[**getPermission**](PermissionsApi.md#getPermission) | **GET** /permissions/{permissionId} | Get Permission |
| 9 | + |
| 10 | + |
| 11 | +<a name="getAssignedPermissions"></a> |
| 12 | +# **getAssignedPermissions** |
| 13 | +> List<Permission> getAssignedPermissions() |
| 14 | +
|
| 15 | +Get Assigned Permission |
| 16 | + |
| 17 | +Returns a list of all permissions currently granted by the user. Permissions are assigned e.g. by subscribing to VRC+. |
| 18 | + |
| 19 | +### Example |
| 20 | +```java |
| 21 | +// Import classes: |
| 22 | +import io.github.vrchatapi.ApiClient; |
| 23 | +import io.github.vrchatapi.ApiException; |
| 24 | +import io.github.vrchatapi.Configuration; |
| 25 | +import io.github.vrchatapi.auth.*; |
| 26 | +import io.github.vrchatapi.models.*; |
| 27 | +import io.github.vrchatapi.api.PermissionsApi; |
| 28 | + |
| 29 | +public class Example { |
| 30 | + public static void main(String[] args) { |
| 31 | + ApiClient defaultClient = Configuration.getDefaultApiClient(); |
| 32 | + defaultClient.setBasePath("https://api.vrchat.cloud/api/1"); |
| 33 | + |
| 34 | + // Configure API key authorization: apiKeyCookie |
| 35 | + ApiKeyAuth apiKeyCookie = (ApiKeyAuth) defaultClient.getAuthentication("apiKeyCookie"); |
| 36 | + apiKeyCookie.setApiKey("YOUR API KEY"); |
| 37 | + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 38 | + //apiKeyCookie.setApiKeyPrefix("Token"); |
| 39 | + |
| 40 | + // Configure API key authorization: authCookie |
| 41 | + ApiKeyAuth authCookie = (ApiKeyAuth) defaultClient.getAuthentication("authCookie"); |
| 42 | + authCookie.setApiKey("YOUR API KEY"); |
| 43 | + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 44 | + //authCookie.setApiKeyPrefix("Token"); |
| 45 | + |
| 46 | + PermissionsApi apiInstance = new PermissionsApi(defaultClient); |
| 47 | + try { |
| 48 | + List<Permission> result = apiInstance.getAssignedPermissions(); |
| 49 | + System.out.println(result); |
| 50 | + } catch (ApiException e) { |
| 51 | + System.err.println("Exception when calling PermissionsApi#getAssignedPermissions"); |
| 52 | + System.err.println("Status code: " + e.getCode()); |
| 53 | + System.err.println("Reason: " + e.getResponseBody()); |
| 54 | + System.err.println("Response headers: " + e.getResponseHeaders()); |
| 55 | + e.printStackTrace(); |
| 56 | + } |
| 57 | + } |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +### Parameters |
| 62 | +This endpoint does not need any parameter. |
| 63 | + |
| 64 | +### Return type |
| 65 | + |
| 66 | +[**List<Permission>**](Permission.md) |
| 67 | + |
| 68 | +### Authorization |
| 69 | + |
| 70 | +[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie) |
| 71 | + |
| 72 | +### HTTP request headers |
| 73 | + |
| 74 | + - **Content-Type**: Not defined |
| 75 | + - **Accept**: application/json |
| 76 | + |
| 77 | +### HTTP response details |
| 78 | +| Status code | Description | Response headers | |
| 79 | +|-------------|-------------|------------------| |
| 80 | +**200** | Returns a list of Permission objects. | - | |
| 81 | +**401** | Error response due to missing apiKey or auth cookie. | - | |
| 82 | + |
| 83 | +<a name="getPermission"></a> |
| 84 | +# **getPermission** |
| 85 | +> Permission getPermission(permissionId) |
| 86 | +
|
| 87 | +Get Permission |
| 88 | + |
| 89 | +Returns a single permission. This endpoint is pretty useless, as it returns the exact same information as `/auth/permissions`. |
| 90 | + |
| 91 | +### Example |
| 92 | +```java |
| 93 | +// Import classes: |
| 94 | +import io.github.vrchatapi.ApiClient; |
| 95 | +import io.github.vrchatapi.ApiException; |
| 96 | +import io.github.vrchatapi.Configuration; |
| 97 | +import io.github.vrchatapi.auth.*; |
| 98 | +import io.github.vrchatapi.models.*; |
| 99 | +import io.github.vrchatapi.api.PermissionsApi; |
| 100 | + |
| 101 | +public class Example { |
| 102 | + public static void main(String[] args) { |
| 103 | + ApiClient defaultClient = Configuration.getDefaultApiClient(); |
| 104 | + defaultClient.setBasePath("https://api.vrchat.cloud/api/1"); |
| 105 | + |
| 106 | + // Configure API key authorization: apiKeyCookie |
| 107 | + ApiKeyAuth apiKeyCookie = (ApiKeyAuth) defaultClient.getAuthentication("apiKeyCookie"); |
| 108 | + apiKeyCookie.setApiKey("YOUR API KEY"); |
| 109 | + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 110 | + //apiKeyCookie.setApiKeyPrefix("Token"); |
| 111 | + |
| 112 | + // Configure API key authorization: authCookie |
| 113 | + ApiKeyAuth authCookie = (ApiKeyAuth) defaultClient.getAuthentication("authCookie"); |
| 114 | + authCookie.setApiKey("YOUR API KEY"); |
| 115 | + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) |
| 116 | + //authCookie.setApiKeyPrefix("Token"); |
| 117 | + |
| 118 | + PermissionsApi apiInstance = new PermissionsApi(defaultClient); |
| 119 | + String permissionId = "permissionId_example"; // String | |
| 120 | + try { |
| 121 | + Permission result = apiInstance.getPermission(permissionId); |
| 122 | + System.out.println(result); |
| 123 | + } catch (ApiException e) { |
| 124 | + System.err.println("Exception when calling PermissionsApi#getPermission"); |
| 125 | + System.err.println("Status code: " + e.getCode()); |
| 126 | + System.err.println("Reason: " + e.getResponseBody()); |
| 127 | + System.err.println("Response headers: " + e.getResponseHeaders()); |
| 128 | + e.printStackTrace(); |
| 129 | + } |
| 130 | + } |
| 131 | +} |
| 132 | +``` |
| 133 | + |
| 134 | +### Parameters |
| 135 | + |
| 136 | +Name | Type | Description | Notes |
| 137 | +------------- | ------------- | ------------- | ------------- |
| 138 | + **permissionId** | **String**| | |
| 139 | + |
| 140 | +### Return type |
| 141 | + |
| 142 | +[**Permission**](Permission.md) |
| 143 | + |
| 144 | +### Authorization |
| 145 | + |
| 146 | +[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie) |
| 147 | + |
| 148 | +### HTTP request headers |
| 149 | + |
| 150 | + - **Content-Type**: Not defined |
| 151 | + - **Accept**: application/json |
| 152 | + |
| 153 | +### HTTP response details |
| 154 | +| Status code | Description | Response headers | |
| 155 | +|-------------|-------------|------------------| |
| 156 | +**200** | Returns a single Permission object. | - | |
| 157 | +**401** | Error response due to missing apiKey or auth cookie. | - | |
| 158 | + |
0 commit comments