Skip to content

BucketsController API Documentation

Lee Sambridge edited this page Jul 9, 2025 · 5 revisions

Buckets API Documentation

This document provides documentation for the Buckets API endpoints available in the Points.Api system.

Table of Contents

Authentication

All endpoints in this API require JWT Bearer authentication. Include a valid JWT token in the Authorization header of your requests.

Authorization: Bearer {your_jwt_token}

Endpoints

Get Points Buckets

Retrieves all point buckets for a specific partner.

URL: /api/Buckets/{partnerId}

Method: GET

Auth required: Yes (JWT Bearer)

URL Parameters:

  • partnerId (long) - The ID of the partner

Success Response:

Example Request:

GET /api/Buckets/123 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer {your_jwt_token}

Example Response:

[
  {
    "id": 1,
    "name": "Fitness",
    "description": "Points earned from fitness activities",
    "points": 0
  },
  {
    "id": 2,
    "name": "Wellness",
    "description": "Points earned from wellness activities",
    "points": 0
  }
]

Update Points Buckets

Updates an existing point bucket for a specific partner.

URL: /api/Buckets/{partnerId}

Method: PATCH

Auth required: Yes (JWT Bearer)

URL Parameters:

  • partnerId (long) - The ID of the partner

Request Body: PointBucket object

Success Response:

  • Code: 200 OK
  • Content: Result object indicating success

Example Request:

PATCH /api/Buckets/123 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer {your_jwt_token}
Content-Type: application/json

{
  "id": 1,
  "bucketName": "Fitness Plus",
  "description": "Enhanced points earned from fitness activities",
  "expiryDate": "2026-01-01T00:00:00Z",
  "showInUi": true,
  "pointBucketsActivityTypes": [
    {
      "id": 1,
      "name": "Running"
    },
    {
      "id": 2,
      "name": "Cycling"
    }
  ]
}

Example Response:

{
  "isSuccess": true,
  "statusCode": 200,
  "message": "Bucket updated successfully"
}

Create Points Buckets

Creates a new point bucket for a specific partner.

URL: /api/Buckets/{partnerId}

Method: POST

Auth required: Yes (JWT Bearer)

URL Parameters:

  • partnerId (long) - The ID of the partner

Request Body: PointBucket object

Success Response:

  • Code: 201 Created
  • Content: Result object indicating success

Example Request:

POST /api/Buckets/123 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer {your_jwt_token}
Content-Type: application/json

{
  "bucketName": "Nutrition",
  "description": "Points earned from nutrition tracking",
  "expiryDate": "2026-01-01T00:00:00Z",
  "showInUi": true,
  "pointBucketsActivityTypes": [
    {
      "id": 5,
      "name": "Meal Logging"
    },
    {
      "id": 6,
      "name": "Water Intake"
    }
  ]
}

Example Response:

{
  "isSuccess": true,
  "statusCode": 201,
  "message": "Bucket created successfully"
}

Models

PointBucket

The PointBucket model represents a bucket that can hold specific types of points.

Field Type Description
bucketName string Required. The name of the bucket
description string Optional. A description of the bucket
expiryDate DateTime? Optional. The date and time when the bucket expires
id long The unique identifier for the bucket
pointBucketsActivityTypes List The list of activity types associated with this bucket
showInUi bool Whether to display this bucket in the UI (default: true)

PointBucketResponse

The PointBucketResponse model represents a simplified view of a point bucket, typically used in responses.

Field Type Description
description string A description of the bucket
id long The unique identifier for the bucket
name string The name of the bucket
points int The number of points in the bucket

ActivityTypeSmallResponse

The ActivityTypeSmallResponse model represents a simplified view of an activity type.

Field Type Description
Active bool Whether the activity type is active (default: true)
Id long The unique identifier for the activity type
Name string The name of the activity type (maximum length: 500)
ActivityTypeId long? Optional reference to the parent activity type ID

Clone this wiki locally