# PyAuthGG

PyAuthGG Python Library Documentation

### Python Auth.GG Package

* Simple
* Lightweight
* User Friendly

### To Do

* [ ] Fix `Application.ChangePassword()`

{% embed url="<https://github.com/xFueY/PyAuthGG>" %}

{% embed url="<https://pypi.org/project/PyAuthGG/>" %}


# Changelogs

List of all changelogs

## 1.0.7 - 25th January 2021

Note: `PyAuthGG.Version` will still return `1.0.6`, will be fixed next update.

#### Added

* Added `Administration.ChangeRank()`
* Added `Administration.SetHWID()`
* Added `Application.GetHWID()`

#### Fixed

#### Removed

## 1.0.6 - 30th December 2020

#### Added

* Added `Application.Status()`
* Added `Administration.Status()`
* Added `Administration.UseLicense()`
* Added Support For License Format 4 `{PREFIX}-{LENGTH}`

#### Fixed

#### Removed

## 1.0.5 - 28th December 2020

#### Added

#### Fixed

* Fixed `Application.ForgotPassword()`

#### Removed

## 1.0.4 - 28th December 2020

#### Added

#### Fixed

* Version & PyPI

#### Removed

## 1.0.3 - 28th December 2020

#### Added

#### Fixed

* Version & PyPI

#### Removed

## 1.0.2 - 28th December 2020

#### Added

#### Fixed

* Version & PyPI

#### Removed

## 1.0.1 - 28th December 2020

#### Added

#### Fixed

* Version & PyPI

#### Removed

## 1.0.0 - 28th December 2020

* Initial Release


# Getting Started

## 1. Installation

You can install [PyAuthGG](https://github.com/xFueY/PyAuthGG) from [PyPI](https://pypi.org/project/PyAuthGG/) using the Python Package Manager PIP.

```
$ pip install PyAuthGG
```

## 2. Importing

{% code title="MyApplication.py" %}

```python
import PyAuthGG
print(PyAuthGG.Version)
```

{% endcode %}

{% hint style="info" %}
You can use PyAuthGG.Version to make sure that you are always using the newest version.
{% endhint %}

## 3. Example

{% code title="MyApplication.py" %}

```python
import PyAuthGG

Admin = PyAuthGG.Administration("API KEY")
print(Admin.FetchUser("xFueY"))
```

{% endcode %}

{% hint style="info" %}
You can get your API key in the application settings on [Auth.GG](https://auth.gg/dashboard/).
{% endhint %}


# Administration()

| Arguments     | Type   | Required | Default |
| ------------- | ------ | -------- | ------- |
| Admin API Key | String | True     |         |

{% hint style="info" %}
The API can be found in the applications settings.
{% endhint %}

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")
```


# Users

Everyting related to users


# FetchUser()

The FetchUser() function can be used for fetching information about a specific user.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchUser("xFueY")
```

### Success Response

```javascript
{
   "status":"success",
   "username":"xFueY",
   "email":"xFueY@mail.com",
   "rank":"0",
   "hwid":"XXXXXXXX-XXX-XXXX-XXXX-XXXXXXXXXXXXXX",
   "variable":"Developer",
   "lastlogin":"2020-12-28 08:09:27",
   "lastip":"1.1.1.1",
   "expiry":"2294-03-29 15:30:41"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# FetchUsedLicenses()

The FetchUsedLicenses() function can be used for fetching all the licenses a user has used.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchUsedLicenses("xFueY")
```

### Success Response

```javascript
{
   "Licenses":[
      {
         "token":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
         "rank":"0",
         "used":"1",
         "used_by":"xFueY",
         "days":"31"
      }
   ]
}
```

### Error Response

```javascript
{
   "Licenses":[
      
   ]
}
```


# FetchUserCount()

The FetchUserCount() function can be used for fetching the total amount of users.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchUsedLicenses("xFueY")
```

### Success Response

```javascript
{
   "status":"success",
   "value":"2"
}
```


# FetchUsers()

The FetchUsers() function can be used for fetching all users.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchUsers()
```

### Success Response

```javascript
{
   "0":{
      "username":"xFueY",
      "email":"xFueY@mail.com",
      "hwid":"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
      "rank":"0",
      "variable":"Test",
      "lastlogin":"2020-12-29 04:33:04",
      "lastip":"1.1.1.1",
      "expiry_date":"2294-03-29 15:30:41"
   },
   "1":{
      "username":"Demo",
      "email":"Demo@mail.com",
      "hwid":"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
      "rank":"0",
      "variable":"Demo",
      "lastlogin":"2020-12-29 06:33:04",
      "lastip":"8.8.8.8",
      "expiry_date":"2294-03-29 15:36:40"
   }
}
```


# DeleteUser()

The DeleteUser() function can be used for deleting a user.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchUsedLicenses("xFueY")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"User has been deleted"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# ChangeVariable()

The ChangeVariable() function can be used for changing a users variable.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |
| Variable  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.ChangeVariable("xFueY", "Variable")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"User variable has been updated"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# ChangeRank()

| Arguments | Type    | Required | Default |
| --------- | ------- | -------- | ------- |
| Username  | String  | True     |         |
| Rank      | Integer | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.ChangeRank("xFueY", 10)
```

### Success Response

```javascript
{
   "status":"success",
   "info":"User rank has been updated"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# ChangePassword()

The ChangePassword() function can be used for changing a users password.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |
| Variable  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.ChangePassword("xFueY", "Password")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"Password has been updated"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# Licenses

Everything related to licenses


# FetchLicense()

The FetchLicense() function can be used for fetching information about a license.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| License   | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchLicense("NRMY7-YPPZ0-SHQR2-5ITYV-GFI40")
```

### Success Response

```javascript
{
   "status":"success",
   "license":"NRMY7-YPPZ0-SHQR2-5ITYV-GFI40",
   "rank":"1",
   "used":"true",
   "used_by":"xFueY",
   "created":"2020-12-29 18:14:45"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No license found"
}
```


# FetchLicenseCount()

The FetchLicenseCount() function can be used for fetching the total amount of licenses.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchLicenseCount()
```

### Success Response

```javascript
{
   "status":"success",
   "value":"55"
}
```


# DeleteLicense()

The DeleteLicense() function can be used for deleting licenses.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| License   | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.DeleteLicense("NRMY7-YPPZ0-SHQR2-5ITYV-GFI40")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"License has been deleted"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No license found"
}
```


# UnuseLicense()

The UnuseLicense() function can be used for un-using licenses.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| License   | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.UnuseLicense("NRMY7-YPPZ0-SHQR2-5ITYV-GFI40")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"License has been updated"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No license found"
}
```


# UseLicense()

The UseLicense() function can be used for deleting licenses.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.UseLicense("NRMY7-YPPZ0-SHQR2-5ITYV-GFI40")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"License has been updated"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No license found"
}
```


# GenerateLicense()

The GenerateLicense() function can be used for generating licenses.

| Arguments | Type    | Required | Default |
| --------- | ------- | -------- | ------- |
| Amount    | Integer | True     |         |
| Days      | Integer | True     |         |
| Level     | Integer | True     |         |
| Format    | Integer | True     |         |
| Prefix    | String  | False    |         |
| Length    | Integer | False    |         |

![Available License Formats](/files/-MPl4b8J0TsbHSKWRNVX)

{% hint style="warning" %}
Make sure to pass a prefix if needed.
{% endhint %}

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.GenerateLicense(2, 31, 1, 4, "XFUEY", 10)
```

### Success Response

```javascript
{
   "0":"XFUEY-D7A7A2HURO",
   "1":"XFUEY-IDBYZHLKPM"
}
```

### Error Response

The following error is returned when a prefix format does not get a prefix passed.

```javascript
{
   "status":"failed",
   "info":"No prefix"
}
```


# HWID

Everything related to HWID's


# FetchHWID()

The FetchHWID() function can be used for fetching a users HWID.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.FetchHWID("xFueY")
```

### Success Response

```javascript
{
   "status":"success",
   "value":"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# ResetHWID()

The ResetHWID() function can be used for resetting a users HWID.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.ResetHWID("xFueY")
```

### Success Response

```javascript
{
   "Licenses":[
      {
         "token":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
         "rank":"0",
         "used":"1",
         "used_by":"xFueY",
         "days":"31"
      }
   ]
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# SetHWID()

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |
| HWID      | String | True     |         |

```python
import PyAuthGG

Admin = PyAuthGG.Administration("ADMIN API KEY")

Admin.SetHWID("xFueY")
```

### Success Response

```javascript
{
   "status":"success",
   "info":"HWID has been succesfully set"
}
```

### Error Response

```javascript
{
   "status":"failed",
   "info":"No user found"
}
```


# Application()

For more responses in different scenarios, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).

| Arguments  | Type   | Required | Default |
| ---------- | ------ | -------- | ------- |
| API Key    | String | True     |         |
| AID        | String | True     |         |
| Secret Key | String | True     |         |

{% hint style="info" %}
The API and AID key can be found on your account page. The Secret Key can be found on your applications page.
{% endhint %}

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")
```


# GetHWID()

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.GetHWID()
```

### Success Response

```
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
```


# Info()

The Info() function can be used for fetching information about the application.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.Info()
```

### Success Response

```javascript
{
   "status":"Enabled",
   "developermode":"Disabled",
   "hash":"8967488e25e7b7c4c4ef056d7ba4f177",
   "version":"1.2.3",
   "downloadlink":"https://example.com/downloads/Application.exe",
   "freemode":"Disabled",
   "login":"Enabled",
   "register":"Enabled",
   "users":"1",
   "name":"xFueYs Application"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# Login()

The Info() function can be used for fetching information about the application.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| Username  | String | True     |         |
| Password  | String | True     |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.Login("xFueY", "Password")
```

### Success Response

```javascript
{
   "result":"success",
   "id":"12345",
   "username":"xFueY",
   "hwid":"XXXXXXXX-XXX-XXXX-XXXX-XXXXXXXXXXXXXX",
   "email":"xFueY@mail.com",
   "uservar":"Variable",
   "rank":"0",
   "ip":"1.1.1.1",
   "expiry":"2294-03-29 15:30:41",
   "variables":{
      
   }
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# Register()

The Info() function can be used for fetching information about the application.

| Arguments | Type   | Required | Default |
| --------- | ------ | -------- | ------- |
| License   | String | True     |         |
| Username  | String | True     |         |
| E-Mail    | String | True     |         |
| Password  | String | True     |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.Register("NRMY7-YPPZ0-SHQR2-5ITYV-GFI40", "xFueY", "xFueY@mail.com", "Pass")
```

### Success Response

```javascript
{
   "result":"success"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# Extend()

The Info() function can be used for fetching information about the application.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.ChangeVariable("xFueY", "Variable")
```

### Success Response

```javascript
{
   "result":"success"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# ForgotPassword()

The Info() function can be used for fetching information about the application.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.ChangeVariable("xFueY", "Variable")
```

### Success Response

```javascript
{
"result":"success"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# ChangePassword()

The Info() function can be used for fetching information about the application.

| Arguments    | Type   | Required | Default |
| ------------ | ------ | -------- | ------- |
| Username     | String | True     |         |
| Old Password | String | True     |         |
| New Password | String | True     |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.ChangePassword("xFueY", "OldPassword", "NewPassword")
```

### Success Response

```javascript
{
"result":"success"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


# Log()

The Info() function can be used for fetching information about the application.

| Arguments | Type | Required | Default |
| --------- | ---- | -------- | ------- |
|           |      |          |         |

```python
import PyAuthGG

App = PyAuthGG.Application("API KEY", "AID", "SECRET_KEY")

App.Log("xFueY", "Logged In")
```

### Success Response

```javascript
{
   "result":"success"
}
```

### Error Response

{% hint style="info" %}
For more responses, please refer to [Auth.GG's Documentation](https://setup.auth.gg/api/application-information).
{% endhint %}


