RSVote.cs Plugin Coming Soon!

The RSVote 3.0.X GUI plugin for Rust servers is currently in final development and will be released soon. This documentation provides a preview of the API and integration capabilities.

Get Notified on Release

RSVote.cs API Documentation
Integration guide for the Rust server vote tracking plugin

Overview

The RSGG.my API allows Rust server owners to create custom short URLs for their server voting pages. This API is compatible with the RSVote.cs Oxide plugin, which provides in-game voting functionality.

Using this API, server owners can create memorable, easy-to-share voting links like rsgg.my/your-server instead of long URLs from voting sites.

Note: The RSVote.cs plugin is coming soon and will be available for download from our the RustServers.gg CP and Codefling

API Endpoints

Create Short URL
Endpoint
POST /api/create.php
Description

Creates a custom short URL for a RustServers.gg server voting page.

Authentication

Requires API key in Authorization header:

Authorization: Bearer your_api_key
Request Body
{
  "server_id": "12345",
  "custom_url": "my-server-name"  // Optional
}
Parameter Type Required Description
server_id String Yes Your RustServers.gg server ID
custom_url String No Custom URL segment (alphanumeric, hyphens). If not provided, server_id will be used.
Response
{
  "success": true,
  "short_url": "https://rsgg.my/my-server-name",
  "message": "Short URL successfully created",
  "vote_url": "https://rustservers.gg/server/12345/"
}
{
  "success": false,
  "error_code": "ERROR_CODE",
  "message": "Error description"
}
Error Code Description
INVALID_CREDENTIALS Invalid server ID or API key
INVALID_REQUEST Missing required fields
INVALID_CUSTOM_URL Custom URL contains invalid characters
CUSTOM_URL_TAKEN The requested custom URL is already in use
DATABASE_ERROR Error creating or updating the short URL

RSVote.cs Plugin Compatibility

Integration with RSVote.cs Plugin

The API is fully compatible with the RSVote.cs Oxide plugin for Rust servers. The plugin uses this API to create personalized short URLs for player voting.

Key compatibility features:

Automated short URL creation from within the plugin
Support for custom URL segments
Player-specific vote tracking with SteamID
URL redirects that maintain vote attribution

Plugin Configuration

In your RSVote.cs plugin, you'll need to configure these settings:

// In your plugin configuration
config.Api.ServerId = "YOUR_SERVER_ID";
config.Api.Key = "YOUR_API_KEY";

// Generate a short URL using
/vadmin shorturl <server_id> <api_key> [custom_url]
Usage Example

When a player uses the short URL (rsgg.my/your-server/76561198xxxxxxxxx), they'll be redirected to your server's vote page with their SteamID automatically included for attribution.

Integration Code Example

C# Example from RSVote.cs

// Generate a short URL for the server
private void GenerateShortUrl(string serverId, string apiKey, string customUrlSegment, Action<bool, string> callback)
{
    if (string.IsNullOrEmpty(serverId) || string.IsNullOrEmpty(apiKey))
    {
        callback(false, "Server ID and API Key are required");
        return;
    }
    
    // Validate custom URL segment if provided
    if (!string.IsNullOrEmpty(customUrlSegment))
    {
        // Basic validation - should be alphanumeric with hyphens, no spaces
        if (!System.Text.RegularExpressions.Regex.IsMatch(customUrlSegment, "^[a-zA-Z0-9-]+$"))
        {
            callback(false, "Custom URL can only contain letters, numbers, and hyphens");
            return;
        }
    }
    else
    {
        // Use server ID as the default
        customUrlSegment = serverId;
    }
    
    // URL to the rsgg.my API endpoint
    string apiUrl = "https://rsgg.my/api/create.php";
    
    // Prepare the request payload
    Dictionary<string, object> payload = new Dictionary<string, object>
    {
        ["server_id"] = serverId,
        ["custom_url"] = customUrlSegment
    };
    
    string json = JsonConvert.SerializeObject(payload);
    
    // Send the request to the API
    webRequests.Enqueue(apiUrl, json, (code, response) => 
    {
        if (code == 200)
        {
            try
            {
                // Parse the response to get the generated short URL
                var data = JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
                if (data.ContainsKey("short_url"))
                {
                    // Update the config
                    config.Api.ServerId = serverId;
                    config.Api.Key = apiKey;
                    config.General.VoteUrl = data["vote_url"];
                    SaveConfig();
                    
                    callback(true, data["short_url"]);
                }
                else
                {
                    callback(false, "Invalid response from URL service");
                }
            }
            catch (Exception ex)
            {
                callback(false, $"Error parsing response: {ex.Message}");
            }
        }
        else
        {
            callback(false, $"Error: API returned code {code}");
        }
    }, this, RequestMethod.POST, new Dictionary<string, string> 
    {
        ["Content-Type"] = "application/json",
        ["Authorization"] = $"Bearer {apiKey}"
    });
}

Frequently Asked Questions

How do player-specific short URLs work?

When a player uses a short URL in the format rsgg.my/your-server/76561198xxxxxxxxx, our system automatically appends their SteamID to the redirect URL. This ensures that the vote is properly attributed to the player on RustServers.gg.

Can I track how many players use my short URL?

Yes. The dashboard provides detailed analytics for your short URLs, including total clicks, unique visitors, and referral sources. You can see which URLs are performing best and optimize your voting campaigns accordingly.

Do I need to update my RSVote plugin?

Yes, as soon as we release 3.0.X on on Website and on Codefling you will need to update your plugin.

What happens if a player has already voted?

The short URL will still redirect them to the RustServers.gg voting page, but RustServers.gg will inform them they've already voted. This behavior is controlled by RustServers.gg, not by our shortlink service.

Need Help?

If you have any questions about the API or need assistance integrating it with your RSVote plugin, please contact our support team.

Contact Support