### Enable and Start LiveKit Service
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Reloads the systemd daemon and starts the LiveKit service.
```bash
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable livekit
sudo systemctl start livekit
```
--------------------------------
### Install LiveKit Server
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Executes the official installation script to set up the LiveKit server binary.
```bash
curl -sSL https://get.livekit.io | bash
```
--------------------------------
### Install Swoole via PECL
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Downloads and installs the Swoole extension using the PHP Extension Community Library.
```bash
sudo pecl install swoole
```
--------------------------------
### Install PHP Dependencies
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Installs the necessary PHP development tools required for PECL extensions.
```bash
sudo apt install php-pear php-dev
```
--------------------------------
### Enable and Start WebSocket Service
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Commands to reload systemd and manage the WebSocket service lifecycle.
```bash
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable websocket.service
sudo systemctl start websocket.service
```
--------------------------------
### Configure Nginx for Subdirectory Integration
Source: https://docs.grupochat.co/nginx-windows-server
Use these location blocks when Grupo is installed in a specific subdirectory. Ensure this block is defined before the generic root location block.
```nginx
location /subfoldername/ {
try_files $uri $uri/ /subfoldername/index.php?$args;
}
location ~* /(subfoldername/assets)/(.+)\.(jpg|jpeg|png|gif|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|webm|bmp|avif|webp|json|woff|woff2|ttf|eot|js|css|map|mov)$ {
allow all;
}
location ~* /(subfoldername/assets/files)/(.+)\.(jpg|jpeg|png|gif|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|avif|webm|bmp|webp|mov)$ {
allow all;
}
location ~ /(subfoldername/fns|subfoldername/pages|subfoldername/include|subfoldername/layouts|subfoldername/assets)/(.+)\.[^\.]+$ {
deny all;
}
```
--------------------------------
### Update System Packages
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Updates the local package index and upgrades installed packages.
```bash
sudo apt update && sudo apt upgrade -y
```
--------------------------------
### Configure Nginx for Root Domain Integration
Source: https://docs.grupochat.co/nginx-windows-server
Use these location blocks when Grupo is installed at the root of your domain.
```nginx
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ /(fns|pages|include|layouts) {
deny all;
return 404;
}
location ~* /(assets)/(.+)\.(jpg|jpeg|png|gif|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|avif|webm|bmp|webp|json|woff|woff2|ttf|eot|js|css|map|mov)$ {
allow all;
}
location ~* /(assets/files)/(.+)\.(jpg|jpeg|png|gif|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|avif|webm|bmp|webp|mov)$ {
allow all;
}
location ~ /(fns|pages|include|layouts|assets)/(.+)\.[^\.]+$ {
deny all;
}
```
--------------------------------
### Create LiveKit Configuration Directory and File
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Prepares the configuration directory and opens the YAML file for editing.
```bash
mkdir /etc/livekit/
nano /etc/livekit/livekit.yaml
```
--------------------------------
### Create Systemd Service File
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Opens the systemd service file for editing to manage the LiveKit process.
```bash
sudo nano /etc/systemd/system/livekit.service
```
--------------------------------
### Create Systemd Service File
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Opens the systemd service configuration file for editing.
```bash
sudo nano /etc/systemd/system/websocket.service
```
--------------------------------
### Configure UFW Firewall
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Opens the necessary TCP and UDP ports for LiveKit traffic and reloads the firewall rules.
```bash
sudo ufw allow 7880/tcp
sudo ufw allow 7881/tcp
sudo ufw allow 7881/udp
sudo ufw reload
```
--------------------------------
### Systemd Service Definition
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
The unit file configuration for running LiveKit as a background service.
```ini
[Unit]
Description=LiveKit Server
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/livekit-server --config /etc/livekit/**livekit.yaml**
Restart=on-failure
RestartSec=5s
User=root
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-create-new-user
Creates a new user account in the Grupo Chatroom system.
```APIDOC
## POST /api_request/
### Description
Creates a new user account in the Grupo Chatroom system by sending user details and an API secret key.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'site_users'
- **full_name** (string) - Required - The full name of the user
- **username** (string) - Required - The desired username
- **email_address** (string) - Required - The user's email address
- **password** (string) - Required - The user's password
- **avatarURL** (string) - Optional - URL for the user's avatar image
- **site_role** (string) - Optional - The role assigned to the user
- **custom_field_1** (string) - Optional - Custom field for user information
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the user account was created successfully
- **error_message** (string) - Error message if the request failed
```
--------------------------------
### LiveKit Configuration YAML
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Defines the server ports and authentication keys required for LiveKit operation.
```yaml
port: 7880
rtc:
udp_port: 7881
tcp_port: 7881
use_external_ip: true
keys:
my-api-key: ENTER_YOUR_32_CHARACTER_SECRET_HERE
```
--------------------------------
### Sync User Information in Sngine Settings
Source: https://docs.grupochat.co/sngine-integration
Insert this require statement into the settings function in includes/class-user.php to trigger user info updates on Grupo.
```php
require(ABSPATH . 'grupo_bridge/grupo_update_user_info.php');
```
--------------------------------
### Include User Update Bridge
Source: https://docs.grupochat.co/quickdate-integration
Insert this line into the QuickDate profile.php file to trigger user information synchronization with Grupo.
```php
require_once 'grupo_bridge/grupo_update_user_info.php';
```
--------------------------------
### Create New User via PHP
Source: https://docs.grupochat.co/api-request-to-create-new-user
Uses cURL to send a POST request to the API endpoint with user details and authentication credentials.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'site_users',
'full_name' => 'Full Name',
'username' => 'username',
'email_address' => 'user@emailaddress.com',
'password' => 'password',
'avatarURL' => 'https://avatar_image_url',
'site_role' => '',
'custom_field_1' => 'About Me',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "User Account Created";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### Verify Bridge Integration Context
Source: https://docs.grupochat.co/quickdate-integration
The required bridge file should be placed immediately following the user ID verification check within the save_general_setting function.
```php
if ($target_id == self::ActiveUser()->id) {
require_once 'grupo_bridge/grupo_update_user_info.php';
```
--------------------------------
### Include User Update Bridge
Source: https://docs.grupochat.co/wowonder-integration
Insert this line into WoWonder's user update files to trigger synchronization with Grupo.
```php
require_once 'grupo_bridge/grupo_update_user_info.php';
```
```php
echo json_encode($data);
require_once 'grupo_bridge/grupo_update_user_info.php';
```
--------------------------------
### POST /api_request/ (Create Group)
Source: https://docs.grupochat.co/category/api-requests/page/2
Creates a new group in the Grupo Chatroom.
```APIDOC
## POST /api_request/
### Description
Creates a new group in the Grupo Chatroom.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Parameters
#### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key.
- **add** (string) - Required - Set to 'groups'.
- **group_name** (string) - Required - The name of the new group to be created.
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-for-single-sign-on
Generates an auto-login URL for a user, optionally creating the account if it does not exist.
```APIDOC
## POST /api_request/
### Description
This endpoint generates an auto-login URL for a specified user. It supports creating a new user account if the provided email address does not exist in the system.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - The secret key for API authentication.
- **add** (string) - Required - Must be set to 'login_session'.
- **create_account** (string) - Required - Whether to create an account if it does not exist ('yes' or 'no').
- **email_address** (string) - Required - The email address of the user.
- **full_name** (string) - Optional - The full name of the user.
- **username** (string) - Optional - The username for the user.
- **password** (string) - Optional - The password for the user.
- **avatarURL** (string) - Optional - The URL for the user's profile image.
- **site_role** (string) - Optional - The site role ID for the user.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the request was successful.
- **auto_login_url** (string) - The generated URL to log the user in automatically.
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/integrate-with-existing-website
This endpoint is used to perform SSO operations, including generating an auto-login URL and optionally creating a new user account if the specified account does not exist.
```APIDOC
## POST /api_request/
### Description
Generates an auto-login URL for a user. Optionally creates a new user account if the provided email does not exist in the system.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - The API secret key for authentication.
- **add** (string) - Required - Must be set to 'login_session'.
- **create_account** (string) - Optional - Whether to create an account if it doesn't exist ('yes'|'no').
- **email_address** (string) - Required - The email address of the user.
- **full_name** (string) - Optional - The full name of the user.
- **username** (string) - Optional - The username for the user.
- **password** (string) - Optional - The password for the user.
- **avatarURL** (string) - Optional - URL for the user profile image.
- **site_role** (string) - Optional - The site role ID for the user.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the request was successful.
- **auto_login_url** (string) - The URL used to log the user into the chat system.
#### Error Response
- **success** (boolean) - Set to false.
- **error_message** (string) - Description of the error encountered.
```
--------------------------------
### Sync User Account Deletion
Source: https://docs.grupochat.co/sngine-integration
Insert this require statement into the delete_user function in includes/class-user.php to remove the user from Grupo when their Sngine account is deleted.
```php
require(ABSPATH . 'grupo_bridge/grupo_delete_user.php');
```
--------------------------------
### Configure Apache Reverse Proxy
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Apache configuration snippet to enable WebSocket tunneling via mod_proxy_wstunnel.
```apache
ProxyPass "/ws/" "ws://127.0.0.1:9502/"
ProxyPassReverse "/ws/" "ws://127.0.0.1:9502/"
```
--------------------------------
### Include User Deletion Bridge
Source: https://docs.grupochat.co/wowonder-integration
Insert this line into the WoWonder account deletion file to remove users from Grupo when they delete their account.
```php
require_once 'grupo_bridge/grupo_delete_user.php';
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-create-group
Creates a new group by sending a POST request to the API endpoint with the required group details.
```APIDOC
## POST /api_request/
### Description
Creates a new group on the platform.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'groups'
- **group_name** (string) - Required - Name of the group
- **description** (string) - Optional - Description of the group
- **slug** (string) - Optional - URL slug for the group
- **group_category_id** (integer) - Optional - ID of the group category
- **secret_group** (string) - Optional - 'yes' or 'no'
- **unleavable** (string) - Optional - 'yes' or 'no'
- **pin_group** (string) - Optional - 'yes' or 'no'
- **password_protect** (string) - Optional - 'yes' or 'no'
- **password** (string) - Optional - Password for the group
- **group_icon_url** (string) - Optional - URL for the group icon
- **custom_field_10** (string) - Optional - Custom field value
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the group was created successfully
- **error_message** (string) - Error message if the request failed
```
--------------------------------
### Create a new group using PHP
Source: https://docs.grupochat.co/api-request-to-create-group
Uses cURL to send a POST request to the API endpoint with group configuration parameters.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'groups',
'group_name' => 'Group Name',
'description' => 'Group Description',
'slug' => 'group_slug',
'group_category_id'=>'1',
'secret_group' => 'no',
'unleavable' => 'no',
'pin_group' => 'no',
'password_protect' => 'no',
'password' => 'password',
'group_icon_url' => 'https://group_icon_image_url',
'custom_field_10' => 'Custom Field Value',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Group Created Successfully.";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### Include User Update Bridge
Source: https://docs.grupochat.co/playtube-integration
Insert this line into the PlayTube user.php file to trigger user information updates in Grupo.
```php
require_once 'grupo_bridge/grupo_update_user_info.php';
```
```php
require_once 'grupo_bridge/grupo_update_user_info.php';
header("Content-type: application/json");
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-add-user-to-a-group
Adds a user to a specified group using the Grupo API.
```APIDOC
## POST /api_request/
### Description
Adds a user to a group by providing the group identifier and the user's username or email address.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'group_members'
- **group** (string) - Required - Group ID or Group Slug
- **user** (string) - Required - Username or email address of the user to add
- **group_role** (string) - Optional - Role to assign to the user
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful
#### Error Response
- **error_message** (string) - Description of the error if the operation failed
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-update-user
Updates user information in the Grupo Chatroom system.
```APIDOC
## POST /api_request/
### Description
Updates user information including profile details and custom fields.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **update** (string) - Required - Must be set to 'site_users'
- **user** (string) - Required - The username or email address of the user to update
- **full_name** (string) - Optional - The new full name
- **username** (string) - Optional - The new username
- **email_address** (string) - Optional - The new email address
- **password** (string) - Optional - The new password
- **avatarURL** (string) - Optional - URL for the user avatar
- **site_role** (string) - Optional - The user role
- **custom_field_1** (string) - Optional - Custom field data
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the update was successful
- **error_message** (string) - Error details if the request failed
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-add-device-token-push-notifications
Registers a device token (Player ID or Subscriber ID) for a specific user to receive push notifications.
```APIDOC
## POST /api_request/
### Description
Registers a device token (Player ID or Subscriber ID) for a specific user to enable push notifications.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'push_subscriber'
- **user** (string) - Required - The username or email address of the user
- **device_token** (string) - Required - The PlayerID or Subscriber ID to register
### Request Example
{
"api_secret_key": "Your_Grupo_API_Secret_Key",
"add": "push_subscriber",
"user": "username/email_address",
"device_token": "PlayerID/SID"
}
```
--------------------------------
### Increase File Descriptor Limits
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Appends configuration to limits.conf to allow a higher number of open file descriptors.
```bash
grep -qxF '* soft nofile 65535' /etc/security/limits.conf || echo '* soft nofile 65535' | sudo tee -a /etc/security/limits.conf
grep -qxF '* hard nofile 65535' /etc/security/limits.conf || echo '* hard nofile 65535' | sudo tee -a /etc/security/limits.conf
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-logout-user
Logs out a user by sending a request to the API with the user's credentials and session removal parameters.
```APIDOC
## POST /api_request/
### Description
Terminates the active session for a specified user.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - The secret key for API authentication.
- **remove** (string) - Required - Set to 'login_session' to trigger logout.
- **user** (string) - Required - The username or email address of the user to log out.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the logout was successful.
- **error_message** (string) - Error details if the request failed.
```
--------------------------------
### Generate Auto Login URL with PHP
Source: https://docs.grupochat.co/api-request-to-create-login-session
Uses cURL to send a POST request to the Grupo API for generating an auto-login session URL.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'login_session',
'user' => 'username/email_address'
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Auto Login URL : ".$response->auto_login_url;
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### Add Device Token via PHP cURL
Source: https://docs.grupochat.co/api-request-to-add-device-token-push-notifications
Uses the cURL library to send a POST request to the API endpoint with the required authentication and device details.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'push_subscriber',
'user' => 'username/email_address',
'device_token' => 'PlayerID/SID',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if (isset($response->error_message)) {
echo $response->error_message;
} else {
echo "Device Added Successfully";
}
}
}
?>
```
--------------------------------
### Integrate Grupo Chat via PHP API
Source: https://docs.grupochat.co/integrate-with-existing-website
Use this PHP script to authenticate users and embed the chat interface via an iframe or redirect.
```php
$api_secret_key,
'add' => 'login_session',
'create_account'=> $create_account,
'email_address' => $email_address,
'full_name' => $full_name,
'username' => $username,
'password' => $password,
'avatarURL' => $avatar,
'site_role' => $site_role_id,
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
if ($iframe_embed) {
echo "";
} else {
header("Location: $response->auto_login_url");
die();
}
} else {
echo $response->error_message;
}
}
}
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-create-login-session
Generates an auto-login URL for a specified user.
```APIDOC
## POST /api_request/
### Description
Generates an auto-login URL for a specified user by providing an API secret key.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'login_session'
- **user** (string) - Required - The username or email address of the user
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the request was successful
- **auto_login_url** (string) - The generated URL for auto-login
#### Error Response
- **success** (boolean) - Indicates failure
- **error_message** (string) - Description of the error encountered
```
--------------------------------
### POST /api_request/ (Add Push Notification Subscriber)
Source: https://docs.grupochat.co/category/api-requests
Adds a user device Player ID or Subscriber ID for push notifications.
```APIDOC
## POST /api_request/
### Description
Adds a user device Player ID or Subscriber ID for push notifications.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Parameters
#### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key.
- **add** (string) - Required - Set to 'push_subscriber'.
- **user** (string) - Required - Username or Email Address of the user.
```
--------------------------------
### WebSocket Systemd Service Definition
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Configuration content for the systemd service to manage the WebSocket process.
```ini
[Unit]
Description=PHP WebSocket Server
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/replace_with_your_grupo_path
ExecStart=php /replace_with_your_grupo_path/websocket.php
Restart=always
RestartSec=3
LimitNOFILE=65535
StandardOutput=append:/var/log/websocket.out.log
StandardError=append:/var/log/websocket.err.log
[Install]
WantedBy=multi-user.target
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-send-a-message-to-a-group
Sends a message to a specified group.
```APIDOC
## POST /api_request/
### Description
Sends a message to a group identified by ID or slug.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'message'
- **group** (string) - Required - Group ID or Group Slug
- **sender** (string) - Required - Username or email address of the sender
- **message** (string) - Optional - The content of the message
- **file_attachments** (string) - Optional - File path for attachments
- **gif_url** (string) - Optional - URL for a GIF
### Request Example
{
"api_secret_key": "Your_Grupo_API_Secret_Key",
"add": "message",
"group": "Group ID/Group Slug",
"sender": "username/email_address",
"message": "Message Content",
"file_attachments": "file_path",
"gif_url": ""
}
```
--------------------------------
### Configure Nginx Reverse Proxy
Source: https://docs.grupochat.co/real-time-with-websocket-ajax
Nginx configuration block to route WebSocket traffic to the local Swoole server.
```nginx
location /ws/ {
proxy_pass http://127.0.0.1:9502;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
keepalive_timeout 3600s;
}
```
--------------------------------
### Update User Information via PHP cURL
Source: https://docs.grupochat.co/api-request-to-update-user
Uses the cURL library to send a POST request to the Grupo Chatroom API with user update parameters.
```php
'Your_Grupo_API_Secret_Key',
'update' => 'site_users',
'user' => 'username/email_address',
'full_name' => 'Full Name',
'username' => 'username',
'email_address' => 'user@emailaddress.com',
'password' => 'password',
'avatarURL' => 'https://avatar_image_url',
'site_role' => '',
'custom_field_1' => 'About Me',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Updated Successfully";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-send-a-private-message
Sends a private message to a specified user or email address.
```APIDOC
## POST /api_request/
### Description
Sends a private message to a user or email address. The request supports text content, file attachments, and GIF URLs.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **add** (string) - Required - Must be set to 'message'
- **user** (string) - Required - The recipient's username or email address
- **sender** (string) - Required - The sender's username or email address
- **message** (string) - Optional - The content of the message
- **file_attachments** (file) - Optional - Path to a file to attach
- **gif_url** (string) - Optional - URL of a GIF to include
### Request Example
{
"api_secret_key": "Your_Grupo_API_Secret_Key",
"add": "message",
"user": "username/email_address",
"sender": "username/email_address",
"message": "Message Content",
"file_attachments": "file_path",
"gif_url": ""
}
### Response
#### Success Response (200)
- **message** (string) - Returns "Message Sent Successfully" on success.
#### Error Handling
- **error_message** (string) - Returned if the request fails.
```
--------------------------------
### Update Group Information with PHP
Source: https://docs.grupochat.co/api-request-to-update-group
Uses cURL to send a POST request to the Grupo API with group configuration parameters.
```php
'Your_Grupo_API_Secret_Key',
'update' => 'groups',
'group' => 'Group ID/Group Slug'
'group_name' => 'Group Name',
'description' => 'Group Description',
'slug' => 'group_slug',
'group_category_id'=>'1',
'secret_group' => 'no',
'unleavable' => 'no',
'pin_group' => 'no',
'password_protect' => 'no',
'password' => 'password',
'group_icon_url' => 'https://group_icon_image_url',
'custom_field_10' => 'Custom Field Value',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Group Updated Successfully.";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### Add User to Group via PHP cURL
Source: https://docs.grupochat.co/api-request-to-add-user-to-a-group
Uses the cURL library to send a POST request to the Grupo API. Ensure the API secret key and group identifiers are correctly configured before execution.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'group_members',
'group' => 'Group ID/Group Slug',
'user' => 'username/email_address',
'group_role' => '',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Added User to Group.";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### Update Group Member Role with PHP
Source: https://docs.grupochat.co/api-request-to-update-a-group-member-role
Uses cURL to send a POST request to the Grupo API with the required authentication and member details.
```php
'Your_Grupo_API_Secret_Key',
'update' => 'group_members',
'group' => 'Group ID/Group Slug',
'user' => 'username/email_address',
'group_role' => '',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $post_fields,
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if ($response->success) {
echo "Updated Group Member's Role";
} else {
echo $response->error_message;
}
}
}
?>
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-delete-user
Removes a user from the website by providing the API secret key and the user identifier.
```APIDOC
## POST /api_request/
### Description
Removes a specified user from the website.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **remove** (string) - Required - Must be set to 'site_users'
- **user** (string) - Required - The username or email address of the user to remove
### Request Example
{
"api_secret_key": "Your_Grupo_API_Secret_Key",
"remove": "site_users",
"user": "username/email_address"
}
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful
- **error_message** (string) - Error details if the operation failed
```
--------------------------------
### Nginx Reverse Proxy Configuration
Source: https://docs.grupochat.co/deploy-livekit-on-your-server
Configures Nginx to proxy WebSocket traffic to the local LiveKit server instance.
```nginx
location / {
proxy_pass http://127.0.0.1:7880;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
keepalive_timeout 3600s;
}
```
--------------------------------
### Embed Grupo Chat Shortcode
Source: https://docs.grupochat.co/wordpress-integration
Use this shortcode in a WordPress page to embed the chat interface. Set require_wp_login to true to enable SSO functionality.
```text
[embed_grupo_pro load_url="" width="100%" height="650px" open_in_parent_window=true require_wp_login=false]
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-remove-a-user-from-a-group
Removes a user from a specified group using the Grupo API.
```APIDOC
## POST /api_request/
### Description
Removes a user from a group by sending a POST request with the required authentication and group member details.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **remove** (string) - Required - Must be set to 'group_members'
- **group** (string) - Required - Group ID or Group Slug
- **user** (string) - Required - Username or email address of the user to remove
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful
- **error_message** (string) - Error message if the operation failed
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-update-a-group-member-role
Updates a group member's role by providing the group identifier, user identifier, and the new role.
```APIDOC
## POST /api_request/
### Description
Updates the role of a specific member within a group.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Request Body
- **api_secret_key** (string) - Required - Your Grupo API Secret Key
- **update** (string) - Required - Must be set to 'group_members'
- **group** (string) - Required - The Group ID or Group Slug
- **user** (string) - Required - The username or email address of the member
- **group_role** (string) - Required - The new role to assign to the member
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the operation was successful
#### Response Example
{
"success": true
}
```
--------------------------------
### POST /api_request/
Source: https://docs.grupochat.co/api-request-to-retrieve-unread-count
Retrieves unread counts for private messages, group messages, site notifications, complaints, and friend requests.
```APIDOC
## POST /api_request/
### Description
Retrieves the current unread counts for private messages, group messages, site notifications, unresolved complaints, and pending friend requests for a specified user.
### Method
POST
### Endpoint
https://yourgrupowebsiteaddress/api_request/
### Parameters
#### Request Body
- **api_secret_key** (string) - Required - The secret key for API authentication.
- **realtime** (boolean) - Required - Set to true to fetch real-time data.
- **user** (string) - Required - The username or email address of the user.
### Response
#### Success Response (200)
- **unread_private_chat_messages** (integer) - Count of unread private messages.
- **unread_group_messages** (integer) - Count of unread group messages.
- **unread_site_notifications** (integer) - Count of unread site notifications.
- **unresolved_complaints** (integer) - Count of unresolved complaints.
- **pending_friend_requests** (integer) - Count of pending friend requests.
```
--------------------------------
### Send a Group Message using PHP
Source: https://docs.grupochat.co/api-request-to-send-a-message-to-a-group
Uses cURL to send a POST request to the group message endpoint. Requires a valid API secret key and group identifier.
```php
'Your_Grupo_API_Secret_Key',
'add' => 'message',
'group' => 'Group ID/Group Slug',
'sender' => 'username/email_address',
'message' => 'Message Content',
'file_attachments' => 'file_path',
'gif_url' => '',
];
$api_request_url = rtrim($grupo_web_address, '/').'/'.'api_request/';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $api_request_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0'
));
if (isset($post_fields['file_attachments']) && !empty($post_fields['file_attachments'])) {
$post_fields['file_attachments'] = new CURLFILE($post_fields['file_attachments']);
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_fields);
$response = curl_exec($curl);
curl_close($curl);
if (!empty($response)) {
$response = json_decode($response);
if (!empty($response)) {
if (isset($response->error_message)) {
echo $response->error_message;
} else {
echo "Message Sent Successfully";
}
}
}
?>
```