# <font >	Get gamelist</font>
## Description

> Get gamelist

> Request mode (Host-> BeSoft) :post

> Encoding method: application/x-www-form-urlencoded

> The data format of the Besoft response is application/json

## Method URL
> {besoftapi}/api/game/subgamelist


## Example
- URL:
    - http://127.0.0.1:8000/api/game/subgamelist
- HTTP Method
    -   POST/GET
- Form Data
``` 
    extension1:testadmin
   ```


 ## Request parameters
| Name | Type | Required | Description |
| -------- | -------- | -------- |    -------- |
| extension1 | string | Y | Merchant account |


##  Parameter analysis of successful results
| Name     | Type     | Required    |     Description        | 
| -------- | -------- | -------- |    -------- |  
| gameicourl    | string     |   Y |     Request game entry icon address |
| gametype   |string |  Y |   Game Type |
| gid| string(20) | Y |  Unique id to enter the game  |


   
 ### 	Successful  Result
```
{
	"gameicourl": "http://127.0.0.1:8000/gameicon",
	"gamelist": [
		{
			"gid": "be001",
			"name": "Dragon Stash",
			"gametype": "1",
			"hot": 1,
			"new": 0
		},
		{
			"gid": "be002",
			"name": "Jungle Fruit",
			"gametype": "1",
			"hot": 1,
			"new": 1
		}
	]
}
```

## The result of failure
```json
 {
	"ret": 1616,
	"info": "ip address error"
}
```


##    Login

###  Descripti on
>Invoke this method with your “Key” (returned by GetKey API) to launch game.

>Game return description: After the game is closed, the return address (return_url= the parameter of the return address), if not filled in, the game has no return button.


##    Method URL
```
http://{BesoftFront}/?key=3F6AE577A2E2255EF4BACF02C9F8BB1154A9C6AD2F19701
568BA675BDA3C46BCA64D243007F87C86119329271708&gid=be001&lang=en&return_url=https://returnyoururl.com

```

> New interface: If you need to close the current window directly, please use the window.open mode to open, and do not need to pass the return_url




> New interface: If the parameter return_url is added, please encode the parameter in URLEncoding mode




> Embedded interface: If it is embedded, please listen for this message notification (closeMessage), the game manufacturer closes the game's call interface


```
{
   window.parent.postMessage("closeMessage", "*")
}


```


## Request Parameter

| Name     | Type    | Required    |   Description       | 
| -------- | -------- | -------- |    -------- |  
| acc     | String(30)     |   Y |     User ID |
| key     |string(86) |  Y |1.Key value returned by “GetKey”    ,   2.Please do URLEncoding on it while using the HTTP GET method) |
| aid | string(20) | Y |      Agent Id  |
| nick | string (50) | Y |      User name Only Support 16 Unicode characters |
| gid| Integer | Y|     input gameId as default launch game ; if blank, go to lobby. |
| lang| string | Y|     default is cn   ,   cn : simplified Chinese     ,   en : english |
| return_url | string | N |      return_url=Game off return address，Please encode the parameters in URLEncoding mode  |

##     Return Result

###  Successful Result

>Redirect Browser to game hall page

###  Failed Result

>The game interface displays the corresponding error message.






## Method for piecing together the address of the game entrance icon request
> gameicourl+/+ gid+"_game_icon_"+Size+"_"+"Language encoding"+.png"

##  Icon Get example
### English
```
Square, Size  300x300 (Default)

https://game.besoft-game.top/gameicon/be025_game_icon_300x300_en.png
```
```
Horizontal rectangle, Size 300x180（Optional）

https://game.besoft-game.top/gameicon/be025_game_icon_300x180_en.png
```
```
Vertical rectangle, Size 225x300（Optional）

https://game.besoft-game.top/gameicon/be025_game_icon_225x300_en.png
```


### Chinese
```
Square, Size  300x300 (Default)

https://game.besoft-game.top/gameicon/be025_game_icon_600x600_zh.png
```
```
Horizontal rectangle, Size 300x180（Optional）

https://game.besoft-game.top/gameicon/be025_game_icon_300x180_zh.png
```
```
Vertical rectangle, Size 225x300（Optional）

https://game.besoft-game.top/gameicon/be025_game_icon_225x300_zh.png
```



### Bahasa Indonesia
```
Square, Size  300x300 (Default)

https://game.besoft-game.top/gameicon/be025_game_icon_300x300_id.png
```
```
Horizontal rectangle, Size 300x180（Optional）

https://game.besoft-game.top/gameicon/be001_game_icon_300x180_id.png
```
```
Vertical rectangle, Size 225x300（Optional）

https://game.besoft-game.top/gameicon/be001_game_icon_225x300_id.png
```


##  Response sample

- Size 300x300

![600x600](../../pic/be025_game_icon_300x300_en.png)

- Size 300x180

![600x600](../../pic/be025_game_icon_300x180_en.png)

- Size 225x300

![600x600](../../pic/be025_game_icon_225x300_en.png)