Skip to content

API Controllers Summary

Lee Sambridge edited this page Jul 14, 2025 · 4 revisions

Points API Controllers Summary

This document provides a summary of all API controllers available in the Points.Api system. Each controller is responsible for a specific area of functionality within the rewards platform.

Authentication

The Authentication controller handles user authentication and token generation.

  • Key Endpoints:
    • GET /api/Authentication/getauthtoken - Generates a JWT token for authenticated API clients

Controllers Overview

Branding Controller

The Branding Controller manages partner branding information, including logos, colors, and sidebar branding.

  • Key Endpoints:
    • GET /api/Branding/{partnerId} - Get branding information for a partner
    • GET /api/Branding/{partnerId}/sidebar - Get sidebar branding for a partner
    • GET /api/Branding/{partnerId}/partner - Get partner branding information

Competitions Controller

The Competitions Controller handles competition-related operations, including entering competitions and managing prize codes.

  • Key Endpoints:
    • GET /api/Competitions/{partnerId} - Get competitions for a partner
    • POST /api/Competitions/{partnerId}/enter/{competitionId}/user/{userId} - Enter a user into a competition
    • GET /api/Competitions/{partnerId}/prizecodes/{userId} - Get prize codes for a user

Country Controller

The Country Controller provides access to country information.

  • Key Endpoints:
    • GET /api/Country - Get a list of all available countries

LeaderBoards Controller

The LeaderBoards Controller manages leaderboards, including creation, user management, and history tracking.

  • Key Endpoints:
    • GET /api/LeaderBoards/{partnerId} - Get all leaderboards for a partner
    • POST /api/LeaderBoards/{partnerId} - Create or update a leaderboard
    • GET /api/LeaderBoards/{partnerId}/current/{leaderboardId} - Get current leaderboard data

Machine Learning Controller

The Machine Learning Controller provides access to machine learning predictions.

  • Key Endpoints:
    • GET /api/ML/{partnerId}/board/{boardId} - Get machine learning prediction results

Partner Activities Controller

The Partner Activities Controller manages activities that partners offer to users.

  • Key Endpoints:
    • GET /api/PartnerActivities/{partnerId} - Get all activities for a partner
    • GET /api/PartnerActivities/{partnerId}/activity/{activityId} - Get details of a specific activity
    • POST /api/PartnerActivities/{partnerId}/activity/ - Create a new activity for a partner
    • PATCH /api/PartnerActivities/{partnerId}/activity/{activityId} - Update an existing activity for a partner

Partner Controller

The Partner Controller handles partner-related operations, including notifications and flags.

  • Key Endpoints:
    • GET /api/Partner/{partnerId}/notifications/user/{userId} - Get active notifications for a user
    • GET /api/Partner/{slug}/slug - Get partner information by slug
    • GET /api/Partner/{partnerId}/flags - Get configuration flags for a partner

Partner FAQs Controller

The Partner FAQs Controller manages frequently asked questions for partners.

  • Key Endpoints:
    • GET /api/PartnerFaqs/Partner/{partnerId} - Get FAQ sections for a partner

Partner Level Points Controller

The Partner Level Points Controller manages point levels for partner rewards.

  • Key Endpoints:
    • GET /api/PartnerLevelPoints/{partnerId} - Get all level points for a partner
    • POST /api/PartnerLevelPoints/{partnerId} - Create or update a partner level point
    • GET /api/PartnerLevelPoints/{partnerId}/level/{levelId} - Get level points for a specific level

Reward Points Controller

The Reward Points Controller manages rewards that users can unlock with points.

  • Key Endpoints:
    • GET /api/RewardPoints/{partnerId} - Get all rewards for a partner
    • GET /api/RewardPoints/{partnerId}/{id} - Get a specific reward by ID
    • PUT /api/RewardPoints/{partnerId}/user/{userId}/reward/{rewardId}/points/{points} - Spend points on a reward

Subscriptions Controller

The Subscriptions Controller manages partner subscriptions.

  • Key Endpoints:
    • GET /api/Subscriptions - Get all subscriptions for the authenticated partner
    • POST /api/Subscriptions - Create a new subscription
    • DELETE /api/Subscriptions/{subscriptionId} - Delete a subscription

User Audit Controller

The User Audit Controller handles user activity auditing.

  • Key Endpoints:
    • POST /api/UserAudit - Create a user audit record

Users Controller

The Users Controller manages user information and authentication.

  • Key Endpoints:
    • GET /api/Users/{userId} - Get user information
    • PUT /api/Users/{userId} - Update user information
    • GET /api/Users/apikey/{apiKey} - Get user by API key

Users Points Controller

The Users Points Controller manages user points, including earning, spending, and tracking.

  • Key Endpoints:
    • GET /api/UsersPoints/{partnerId}/user/{userId} - Get points for a user
    • POST /api/UsersPoints/{partnerId}/user/{userId}/activity/{activityId} - Add points for an activity
    • GET /api/UsersPoints/{partnerId}/user/{userId}/history - Get points history for a user

Authentication Requirements

All endpoints (except where noted) require JWT Bearer authentication. Include the JWT token in the Authorization header of your requests:

Authorization: Bearer {your_jwt_token}

To obtain a JWT token, use the Authentication controller's getauthtoken endpoint with a valid API key.

Common Response Formats

Most API endpoints return responses in the following format:

{
  "success": true,
  "data": { ... },
  "message": "Operation completed successfully"
}

Error responses typically include:

{
  "success": false,
  "message": "Error message describing what went wrong"
}

Rate Limiting

API requests are subject to rate limiting. If you exceed the rate limit, you will receive a 429 Too Many Requests response.

Further Information

For detailed information about each controller and its endpoints, click on the controller links above to view the full documentation.

Clone this wiki locally