Skip to content

PartnerActivitiesController API Documentation

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

Partner Activities API Documentation

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

Table of Contents

Authentication

All endpoints in the Partner Activities API require JWT Bearer authentication. Include the JWT token in the Authorization header of your requests:

Authorization: Bearer {your_jwt_token}

Endpoints

Get Activity

Retrieves details about a specific activity type for a partner.

URL: /api/PartnerActivities/{partnerId}/activity/{activityId}

Method: GET

Auth required: Yes (JWT Bearer token)

URL Parameters:

  • partnerId (long) - ID of the partner
  • activityId (long) - ID of the activity

Success Response:

  • Code: 200 OK
  • Content: Activity type details

Example Request:

GET /api/PartnerActivities/123/activity/456 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Example Response:

{
  "id": 456,
  "name": "Running",
  "description": "Running activity",
  "pointsPerUnit": 10,
  "unit": "km",
  "isActive": true
}

Get Activities

Retrieves all activity types for a partner.

URL: /api/PartnerActivities/{partnerId}

Method: GET

Auth required: Yes (JWT Bearer token)

URL Parameters:

  • partnerId (long) - ID of the partner

Success Response:

  • Code: 200 OK
  • Content: List of activity types

Example Request:

GET /api/PartnerActivities/123 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Example Response:

[
  {
    "id": 1,
    "name": "Running",
    "description": "Running activity",
    "pointsPerUnit": 10,
    "unit": "km",
    "isActive": true
  },
  {
    "id": 2,
    "name": "Cycling",
    "description": "Cycling activity",
    "pointsPerUnit": 5,
    "unit": "km",
    "isActive": true
  },
  {
    "id": 3,
    "name": "Swimming",
    "description": "Swimming activity",
    "pointsPerUnit": 20,
    "unit": "km",
    "isActive": true
  }
]

Create Activity

Creates a new activity type for a partner.

URL: /api/PartnerActivities/{partnerId}/activity/

Method: POST

Auth required: Yes (JWT Bearer token)

URL Parameters:

  • partnerId (long) - ID of the partner

Request Body:

{
  "name": "Walking",
  "description": "Walking activity",
  "pointsPerUnit": 5,
  "unit": "km",
  "isActive": true
}

Success Response:

  • Code: 200 OK
  • Content: Newly created activity

Example Request:

POST /api/PartnerActivities/123/activity/ HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

{
  "name": "Walking",
  "description": "Walking activity",
  "pointsPerUnit": 5,
  "unit": "km",
  "isActive": true
}

Example Response:

{
  "id": 789,
  "name": "Walking",
  "description": "Walking activity",
  "pointsPerUnit": 5,
  "unit": "km",
  "isActive": true
}

Update Activity

Updates an existing activity type for a partner.

URL: /api/PartnerActivities/{partnerId}/activity/{activityId}

Method: PATCH

Auth required: Yes (JWT Bearer token)

URL Parameters:

  • partnerId (long) - ID of the partner
  • activityId (long) - ID of the activity to update

Request Body:

{
  "name": "Fast Walking",
  "description": "Fast walking activity",
  "pointsPerUnit": 7,
  "unit": "km",
  "isActive": true
}

Success Response:

  • Code: 200 OK
  • Content: Updated activity

Example Request:

PATCH /api/PartnerActivities/123/activity/789 HTTP/1.1
Host: your-api-domain.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

{
  "name": "Fast Walking",
  "description": "Fast walking activity",
  "pointsPerUnit": 7,
  "unit": "km",
  "isActive": true
}

Example Response:

{
  "id": 789,
  "name": "Fast Walking",
  "description": "Fast walking activity",
  "pointsPerUnit": 7,
  "unit": "km",
  "isActive": true
}

Clone this wiki locally