> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).

# Class ksEditorWebService

Namespace: [KS.Unity.Editor](/reactor/api-reference/ks.unity.editor.md)\
Assembly: KSUnity-Editor.dll

This class is used to manage KinematicSoup web service requests and login state

```csharp
[InitializeOnLoad]
public class ksEditorWebService : ksSingleton<ksEditorWebService>
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← Object ← ScriptableObject ← [ksSingleton\<ksEditorWebService>](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kssingleton-1.md) ← [ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md)

#### Inherited Members

[ksSingleton\<ksEditorWebService>.Get()](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kssingleton-1.md#KS_Unity_Editor_ksSingleton_1_Get), [ksSingleton\<ksEditorWebService>.Initialize()](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kssingleton-1.md#KS_Unity_Editor_ksSingleton_1_Initialize), [ksSingleton\<ksEditorWebService>.Create()](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kssingleton-1.md#KS_Unity_Editor_ksSingleton_1_Create), ScriptableObject.SetDirty(), ScriptableObject.CreateInstance(string), ScriptableObject.CreateInstance(Type), ScriptableObject.CreateInstance\<T>(), Object.GetInstanceID(), Object.GetHashCode(), Object.Equals(object), Object.Instantiate(Object, Vector3, Quaternion), Object.Instantiate(Object, Vector3, Quaternion, Transform), Object.Instantiate(Object), Object.Instantiate(Object, Transform), Object.Instantiate(Object, Transform, bool), Object.Instantiate\<T>(T), Object.Instantiate\<T>(T, Vector3, Quaternion), Object.Instantiate\<T>(T, Vector3, Quaternion, Transform), Object.Instantiate\<T>(T, Transform), Object.Instantiate\<T>(T, Transform, bool), Object.Destroy(Object, float), Object.Destroy(Object), Object.DestroyImmediate(Object, bool), Object.DestroyImmediate(Object), Object.FindObjectsOfType(Type), Object.FindObjectsOfType(Type, bool), Object.FindObjectsByType(Type, FindObjectsSortMode), Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode), Object.DontDestroyOnLoad(Object), Object.DestroyObject(Object, float), Object.DestroyObject(Object), Object.FindSceneObjectsOfType(Type), Object.FindObjectsOfTypeIncludingAssets(Type), Object.FindObjectsOfType\<T>(), Object.FindObjectsByType\<T>(FindObjectsSortMode), Object.FindObjectsOfType\<T>(bool), Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode), Object.FindObjectOfType\<T>(), Object.FindObjectOfType\<T>(bool), Object.FindFirstObjectByType\<T>(), Object.FindAnyObjectByType\<T>(), Object.FindFirstObjectByType\<T>(FindObjectsInactive), Object.FindAnyObjectByType\<T>(FindObjectsInactive), Object.FindObjectsOfTypeAll(Type), Object.FindObjectOfType(Type), Object.FindFirstObjectByType(Type), Object.FindAnyObjectByType(Type), Object.FindObjectOfType(Type, bool), Object.FindFirstObjectByType(Type, FindObjectsInactive), Object.FindAnyObjectByType(Type, FindObjectsInactive), Object.ToString(), Object.name, Object.hideFlags, [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Properties

### AccountId <a href="#ks_unity_editor_kseditorwebservice_accountid" id="ks_unity_editor_kseditorwebservice_accountid"></a>

Get / Set the account ID

```csharp
public static uint AccountId { get; set; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### Email <a href="#ks_unity_editor_kseditorwebservice_email" id="ks_unity_editor_kseditorwebservice_email"></a>

Set / Get Email Address (If the email is cleared, then clear the token as well)

```csharp
public static string Email { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### IAccountId <a href="#ks_unity_editor_kseditorwebservice_iaccountid" id="ks_unity_editor_kseditorwebservice_iaccountid"></a>

Get / Set the account ID of a non static instance

```csharp
public uint IAccountId { get; set; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### IEmail <a href="#ks_unity_editor_kseditorwebservice_iemail" id="ks_unity_editor_kseditorwebservice_iemail"></a>

Get / Set the email of a non static instance

```csharp
public string IEmail { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### IToken <a href="#ks_unity_editor_kseditorwebservice_itoken" id="ks_unity_editor_kseditorwebservice_itoken"></a>

Get / Set the token of a non static instance

```csharp
public string IToken { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### IUsername <a href="#ks_unity_editor_kseditorwebservice_iusername" id="ks_unity_editor_kseditorwebservice_iusername"></a>

Get / Set the username of a non static instance

```csharp
public string IUsername { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### IsLoggedIn <a href="#ks_unity_editor_kseditorwebservice_isloggedin" id="ks_unity_editor_kseditorwebservice_isloggedin"></a>

Check for a valid email and auth token (Non null)

```csharp
public static bool IsLoggedIn { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### IsLoggingIn <a href="#ks_unity_editor_kseditorwebservice_isloggingin" id="ks_unity_editor_kseditorwebservice_isloggingin"></a>

Check if a login is in progress

```csharp
public static bool IsLoggingIn { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Token <a href="#ks_unity_editor_kseditorwebservice_token" id="ks_unity_editor_kseditorwebservice_token"></a>

Set / Get Authentication Token

```csharp
public static string Token { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### UseStoredCredentials <a href="#ks_unity_editor_kseditorwebservice_usestoredcredentials" id="ks_unity_editor_kseditorwebservice_usestoredcredentials"></a>

Return if this session uses stored email and tokens

```csharp
public bool UseStoredCredentials { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Username <a href="#ks_unity_editor_kseditorwebservice_username" id="ks_unity_editor_kseditorwebservice_username"></a>

Get username

```csharp
public static string Username { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### Get(string, RequestCallback) <a href="#ks_unity_editor_kseditorwebservice_get_system_string_ks_unity_editor_kseditorwebservice_requestcallb" id="ks_unity_editor_kseditorwebservice_get_system_string_ks_unity_editor_kseditorwebservice_requestcallb"></a>

Send a web GET request which returns JSON data.

```csharp
public static void Get(string url, ksEditorWebService.RequestCallback requestCallback)
```

#### Parameters

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

`requestCallback` [ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).[RequestCallback](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice/ks.unity.editor.kseditorwebservice.requestcallback.md)

### Init() <a href="#ks_unity_editor_kseditorwebservice_init" id="ks_unity_editor_kseditorwebservice_init"></a>

Start and register updates for a coroutine manager

```csharp
public static void Init()
```

### Login(string, string, string) <a href="#ks_unity_editor_kseditorwebservice_login_system_string_system_string_system_string" id="ks_unity_editor_kseditorwebservice_login_system_string_system_string_system_string"></a>

Login to KinematicSoup Web Services

```csharp
public static void Login(string url, string email, string password)
```

#### Parameters

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

login url

`email` [string](https://learn.microsoft.com/dotnet/api/system.string)

email

`password` [string](https://learn.microsoft.com/dotnet/api/system.string)

password

### Logout(string) <a href="#ks_unity_editor_kseditorwebservice_logout_system_string" id="ks_unity_editor_kseditorwebservice_logout_system_string"></a>

Logout

```csharp
public static void Logout(string url)
```

#### Parameters

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

logout url

### Send(ksJSON, string, RequestCallback) <a href="#ks_unity_editor_kseditorwebservice_send_ks_reactor_ksjson_system_string_ks_unity_editor_kseditorwebs" id="ks_unity_editor_kseditorwebservice_send_ks_reactor_ksjson_system_string_ks_unity_editor_kseditorwebs"></a>

Send an editor web request to a KinematicSoup service

```csharp
public static void Send(ksJSON request, string url, ksEditorWebService.RequestCallback requestCallback)
```

#### Parameters

`request` [ksJSON](/reactor/api-reference/ks.reactor/ks.reactor.ksjson.md)

request parameters

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

url

`requestCallback` [ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).[RequestCallback](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice/ks.unity.editor.kseditorwebservice.requestcallback.md)

callback

### Update() <a href="#ks_unity_editor_kseditorwebservice_update" id="ks_unity_editor_kseditorwebservice_update"></a>

Update the coroutine manager used for editor web requests

```csharp
public static void Update()
```

### Upload(ksJSON, FileInfo\[], string, RequestCallback) <a href="#ks_unity_editor_kseditorwebservice_upload_ks_reactor_ksjson_system_io_fileinfo___system_string_ks_un" id="ks_unity_editor_kseditorwebservice_upload_ks_reactor_ksjson_system_io_fileinfo___system_string_ks_un"></a>

Upload files to a KinematicSoup service

```csharp
public static void Upload(ksJSON request, FileInfo[] files, string url, ksEditorWebService.RequestCallback requestCallback)
```

#### Parameters

`request` [ksJSON](/reactor/api-reference/ks.reactor/ks.reactor.ksjson.md)

request parameters

`files` [FileInfo](https://learn.microsoft.com/dotnet/api/system.io.fileinfo)\[]

list of files to upload

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

url

`requestCallback` [ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).[RequestCallback](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice/ks.unity.editor.kseditorwebservice.requestcallback.md)

callback

### OnLogin <a href="#ks_unity_editor_kseditorwebservice_onlogin" id="ks_unity_editor_kseditorwebservice_onlogin"></a>

```csharp
public static event ksEditorWebService.RequestCallback OnLogin
```

#### Event Type

[ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).[RequestCallback](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice/ks.unity.editor.kseditorwebservice.requestcallback.md)

### OnLogout <a href="#ks_unity_editor_kseditorwebservice_onlogout" id="ks_unity_editor_kseditorwebservice_onlogout"></a>

```csharp
public static event ksEditorWebService.RequestCallback OnLogout
```

#### Event Type

[ksEditorWebService](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice.md).[RequestCallback](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorwebservice/ks.unity.editor.kseditorwebservice.requestcallback.md)
