Create Community Link
Create a short-lived community user link code.
Request Body
{
"communityUserId": "player_12345"
}Example Request
-- luarocks install sonoran.lua
-- For SonoranCADFiveM in-game usage, see the SonoranCADFiveM tab for the export-based client.
local Sonoran = require("sonoran")
local sonoran = Sonoran.createClient({
product = Sonoran.productEnums.CAD,
communityId = "YOUR_COMMUNITY_ID",
apiKey = "YOUR_API_KEY",
defaultServerId = 1
})
local response = sonoran.cad:createCommunityLinkV2({
communityUserId = 'player_12345',
})
-- Inspect response.success, response.data, or response.reason as needed.
print(response.success)local cad = exports["sonorancad"]:getCadClient()const cad = exports["sonorancad"].getCadClient();// dotnet add package Sonoran.Net
using CitizenFX.Core.Native;
using Sonoran;
var communityId = API.GetConvar("sonoran_communityID", "");
var apiKey = API.GetConvar("sonoran_apiKey", "");
var serverIdRaw = API.GetConvar("sonoran_serverId", "1");
var serverId = int.TryParse(serverIdRaw, out var parsedServerId) ? parsedServerId : 1;
using var sonoran = new SonoranClient(new SonoranClientOptions
{
product = SonoranProduct.CAD,
communityId = communityId,
apiKey = apiKey,
defaultServerId = serverId
});Response
Linking Account


Last updated
Was this helpful?

