Base URL: /api, Version: v1
Yupi Emulator is an open-source HH Emulator, being designed and writed in C#. Yupi will have a new ultimate feature, the Emulator REST API. You will know now for what this API is deserved and its intentions.
This API deserve to be a way of external commands communication with the Emulator. The intention it's that the Emulator Database (SQL) will not be editable by the end-user, or the developer. Since the Emulator is totally controlled with reactive datas and using an ORM way of service providing. The main intention of this API it's the ability of serve native commands to change any database table content, with a MVC engine provided by the Emulator, with an interaction system, able to handle those commands and decide with action need to be taken. As an example, editing a room, will make that a specific controller handle it, after the alteration of the data and abling to the room being reloaded (packets). In other way this API will serve RCON commands, like "broadcast", and such other commands.
Through the REST API you will be able to edit any data related to in-game things. Like Navigator, Catalogue, Furniture, Users, User Permissions, Groups, Bots, Pets and more. This API it's totally experimental, and being designed.
The HTTP Request will be handled by the REST Module of the Emulator. Every Actor of the system (Eg.: Users) will have a desired Controller module that will Handler a specific Interaction. In case of Users, the Handler will send a Composer to the Client updating user information. And send a message to REST Module like "Edited User Data Successfully" (converted to jSON with HTTP Codes). NHibernate will update the Models and send it back to Database through Transactions.
The REST API will follow HTTP codes, like {200, 404, 500, and others} and also it owns Response Codes, in HTTP Header.
The server will be obrigatory using TLS connection. (HTTPS:// Wrapper). You can disable it in the Settings of the Emulator, but is not recommended. The Emulator will only answer Requests through a White List in the Emulator Settings. Also the Authentication will be made by a Token.
The token will be a BASE64 + MCRYPT 24 Bit Length Shared Key. The Key will be stored in the Application (Like CMS) and in the Emulator. Futurely each application will have an own Token. The connection will be secure by TLS 1.2 + RC4 Encryption
| Operation | Description |
|---|---|
| GET /auth/{auth-token} |
| Operation | Description |
|---|---|
| POST /auth/{auth-token} |
| Operation | Description |
|---|---|
| GET /sso/{user-id} |
| Operation | Description |
|---|---|
| GET /user/{user-id} |
| Operation | Description |
|---|---|
| PUT /user/{user-id} |
| Operation | Description |
|---|---|
| POST /user/{user-id} |
Check if Token is Valid
| auth-token | The Administractive Token |
path | string | #/parameters/auth-token |
Uses default content-types: application/json
200 OK Created Token
Invalid Token
Token not Found
Create a new token providing Administrator Token
| auth-token | The Administractive Token |
path | string | #/parameters/auth-token |
Uses default content-types: application/json
200 OK Created Token
Invalid Token
Auth user in client to return SSO code
| token | The Session Token Identifier |
query | string | #/parameters/token |
| user-id | The user identifier number |
path | number | #/parameters/user-id |
Uses default content-types: application/json
The SSO object
Get User Data
| token | The Session Token Identifier |
query | string | #/parameters/token |
| user-id | The user identifier number |
path | number | #/parameters/user-id |
Uses default content-types: application/json
User Data
Not Allowed (Invalid or Expired Token)
Not Found (User not Found)
Create a new User
Uses default content-types: application/json
The user sex parameter
| user-name | The user name |
query | string | |
| user-look | The user look |
query | string | |
| user-rank | The user rank |
query | number | |
| user-mail | The user Mail |
query | string | |
| token | The Session Token Identifier |
query | string | #/parameters/token |
| user-id | The user identifier number |
path | number | #/parameters/user-id |
Uses default content-types: application/json
OK Response
User already exists
Not Allowed (Invalid or Expired Token)
Edit user Data
Uses default content-types: application/json
The user sex parameter
| user-name | The user name |
query | string | |
| user-look | The user look |
query | string | |
| user-rank | The user rank |
query | number | |
| user-mail | The user Mail |
query | string | |
| token | The Session Token Identifier |
query | string | #/parameters/token |
| user-id | The user identifier number |
path | number | #/parameters/user-id |
Uses default content-types: application/json
OK Response
Not Allowed (Invalid or Expired Token)
Not Found (User not Found)
| user-id | user-id | The user identifier number |
path | number | |
| token | token | The Session Token Identifier |
query | string | |
| auth-token | auth-token | The Administractive Token |
path | string |