Get Participant Progress
GET /v1/campaigns/{slug}/participants/{userId}Returns a participant’s current standing in the campaign, including total points, event count, and rank.
Authentication
Section titled “Authentication”| Header | Required | Value |
|---|---|---|
X-API-Secret | Yes | Your secret key |
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
slug | string | Campaign slug |
userId | string | The user’s ID in your system |
Request Examples
Section titled “Request Examples”curl -X GET "https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/user_12345" \ -H "X-API-Secret: sk_live_your_secret_key"const userId = 'user_12345';
const response = await fetch( `https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/${userId}`, { headers: { 'X-API-Secret': 'sk_live_your_secret_key' }, });
const data = await response.json();console.log(`${data.data.displayName}: rank #${data.data.rank}, ${data.data.totalPoints} pts`);import requests
user_id = "user_12345"
response = requests.get( f"https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/{user_id}", headers={"X-API-Secret": "sk_live_your_secret_key"},)
data = response.json()print(f"{data['data']['displayName']}: rank #{data['data']['rank']}, {data['data']['totalPoints']} pts")import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.URI;
String userId = "user_12345";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/" + userId)) .header("X-API-Secret", "sk_live_your_secret_key") .GET() .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());userId := "user_12345"url := fmt.Sprintf("https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/%s", userId)
req, _ := http.NewRequest("GET", url, nil)req.Header.Set("X-API-Secret", "sk_live_your_secret_key")
resp, err := http.DefaultClient.Do(req)if err != nil { log.Fatal(err)}defer resp.Body.Close()
var result map[string]interface{}json.NewDecoder(resp.Body).Decode(&result)fmt.Println(result["data"])$userId = 'user_12345';
$ch = curl_init("https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/{$userId}");curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'X-API-Secret: sk_live_your_secret_key', ],]);
$response = curl_exec($ch);curl_close($ch);
$data = json_decode($response, true);echo "{$data['data']['displayName']}: rank #{$data['data']['rank']}\n";require 'net/http'require 'json'
user_id = 'user_12345'
uri = URI("https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/#{user_id}")req = Net::HTTP::Get.new(uri)req['X-API-Secret'] = 'sk_live_your_secret_key'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }data = JSON.parse(res.body)puts "#{data['data']['displayName']}: rank ##{data['data']['rank']}"using var client = new HttpClient();client.DefaultRequestHeaders.Add("X-API-Secret", "sk_live_your_secret_key");
var userId = "user_12345";var response = await client.GetAsync( $"https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/{userId}");var json = await response.Content.ReadAsStringAsync();Console.WriteLine(json);import 'dart:convert';import 'package:http/http.dart' as http;
const userId = 'user_12345';
final response = await http.get( Uri.parse('https://api.gamifyhost.com/v1/campaigns/summer-promo/participants/$userId'), headers: {'X-API-Secret': 'sk_live_your_secret_key'},);
final data = jsonDecode(response.body);print('${data['data']['displayName']}: rank #${data['data']['rank']}');Response
Section titled “Response”Status: 200 OK
{ "status": "success", "data": { "userId": "user_12345", "displayName": "Alice", "totalPoints": 2500, "eventsCount": 12, "rank": 3, "joinedAt": "2025-07-01T10:00:00Z" }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
userId | string | The user’s external ID |
displayName | string | Display name |
totalPoints | integer | Total points earned |
eventsCount | integer | Number of events recorded |
rank | integer | Current leaderboard rank |
joinedAt | datetime | When the user joined the campaign |
Errors
Section titled “Errors”| Code | Message |
|---|---|
404 | Campaign or participant not found |