> For the complete documentation index, see [llms.txt](https://framework.pokerscript.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.pokerscript.net/connector-apis/plateform-api.md).

# Plateform API

Seamless Integration, Game Access, and Deployment.

## Overview

This  **Platform** **API** allows operators to integrate the poker platform into their existing system with the required parameters. Pre-registered users can access the game, and new users can also be registered seamlessly.

## **Endpoint**

`POST http://admin.pokerurl.com/api/connect-domain`

## Headers

| Key            | Value              | Description               |
| -------------- | ------------------ | ------------------------- |
| `Accept`       | `application/JSON` | Specifies response format |
| `Content-Type` | `application/JSON` | Specifies request format  |

## Request Body

The request body should be formatted in JSON and include the following fields:

```json
{
    "username": "username",
    "password": "123456",
    "firstname": "first",
    "lastname": "last",
    "phone_number": "++19177649944",
    "email": "support@pokerscript.net",
    "balance": "100.00",
    "pokerUserId": "002025"
}
```

#### Parameters

| Parameter      | Type   | Description                          |
| -------------- | ------ | ------------------------------------ |
| `username`     | string | Unique username for the player       |
| `password`     | string | Secure password for authentication   |
| `firstname`    | string | First name of the player             |
| `lastname`     | string | Last name of the player              |
| `phone_number` | string | Contact number of the player         |
| `email`        | string | Email address of the player          |
| `balance`      | string | User's current balance in the system |
| `pokerUserId`  | string | Unique poker user ID                 |

## Success Response

Upon successful user registration, the API returns a `200 OK` status with the following response:

```json
{
    "status": true,
    "message": "User Connect Successfully.",
    "data": {
        "poker-token": "sgr5reg14e5rh1er5h1rh5"
    }
}
```

#### Response Parameters

| Parameter     | Type    | Description                               |
| ------------- | ------- | ----------------------------------------- |
| `status`      | boolean | Indicates if the request was successful   |
| `message`     | string  | Response message                          |
| `poker-token` | string  | Authentication token for playing the game |

## Error Responses

If the request fails, an error response is returned with the corresponding status code:

#### `401 Unauthorized`

```json
{
    "status": false,
    "message": "Invalid Authorization Token"
}
```

#### `404 Not Found`

```json
{
    "status": false,
    "message": "User Not Found"
}
```

#### `500 Internal Server Error`

```json
{
    "status": false,
    "message": "Something Went Wrong"
}
```

## Additional Notes

* Once a token is obtained, redirect the user to: `{{pokerurl}}/#/login/poker-token`
* Ensure that all required fields are included in the request body to prevent errors.
* The poker token should be securely stored and used for authentication during gameplay.
