# Get Users

Use this method to get information of multiple users at same time such as Name, Bio, social etc. etc. \
\
\&#xNAN;*On success, the data is returned as JSON.*

### Usage in your script

```csharp
GetUsers
  .Initialize(destroyAtEnd: true)
  .SetParameters(
    perPage: "20",
    page: "1",
    sortBy: "name",
    sortDir: "asc"
  )
  .filter(//optional
  name: "Altura",
  )
  .OnError(error => Debug.Log(error))
  .OnComplete(result => Debug.Log(result))
  .Run();
```

#### Member Functions

**`.Initialize()`**

<table><thead><tr><th width="193">Parameter</th><th width="80">Type</th><th width="105">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>destroyAtEnd</code></td><td><strong>bool</strong></td><td><strong>Optional</strong></td><td>defines if this component will be destroyed after <code>.Run()</code></td></tr></tbody></table>

**`.SetParameters()`**

<table><thead><tr><th width="193.33333333333331">Parameter</th><th width="88">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td>perPage</td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>Amount of users per page.</td></tr><tr><td>page</td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>Amount of pages</td></tr><tr><td>sortBy</td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>The field to sort the users by (any field in the user schema may be used)</td></tr><tr><td>sortDir</td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>Choose to sort in ascending (asc) or descending (desc) order</td></tr></tbody></table>

**`.filter()`**

<table><thead><tr><th>Parameter</th><th width="93">Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td><strong>String</strong></td><td>Optional</td><td>filter by user address</td></tr><tr><td>name</td><td><strong>String</strong></td><td>Optional</td><td>filter by user Name</td></tr><tr><td>bio</td><td><strong>String</strong></td><td>Optional</td><td>filter by user Bio</td></tr></tbody></table>

**`.onError()`**

*Action on Error: returns error information.*

**`.onComplete()`**

*Action on successful: returns*[ *`User_model`* ](https://docs.altura.com/altura-documentation-1/schema#user-model)*type.*

**`.Run()`**

*Runs the API call and fills the corresponding model in the component on success.*

###
