Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 10, 2025

Summary

This PR updates the PhishLabs integration to use the official Case Creation API endpoint (https://caseapi.phishlabs.com/v1/create) as documented at https://caseapi.phishlabs.com/v1/create/docs/.

Changes Made

API Models

Updated the internal API request/response models to align with the Case Creation API specification:

Request Model (PhishLabsApiRequest):

  • Added CaseType field (defaults to "Phishing")
  • Added Title field to provide a summary of the case
  • Updated Description field to include both the reported URL and user-provided details
  • Removed legacy Url and Timestamp fields

Response Model (PhishLabsApiResponse):

  • Renamed IncidentId to CaseId to match the Case Creation API response format

Service Implementation

Updated PhishLabsService to construct requests according to the Case Creation API format:

  • Title is set to "Suspicious URL: {url}" for easy identification
  • Description includes the full URL and any additional details provided by the user
  • Updated logging to reference "case" terminology instead of "incident"

Configuration

Updated default configuration to use the Case Creation API:

  • Changed ApiBaseUrl from https://api.phishlabs.com to https://caseapi.phishlabs.com
  • Changed ServicePath from /incidents/your-service to /v1/create

Testing

  • Updated all unit tests to reflect the new API structure
  • Fixed package version conflicts (upgraded Microsoft.Extensions packages to 9.0.4)
  • All 17 tests pass successfully ✅

Documentation

Updated PhishLabsIncidentReporter.md with the new API endpoint configuration.

Benefits

  • Uses the official PhishLabs Case Creation API as intended
  • Follows the standard case type structure ("Phishing")
  • Provides better structured data to PhishLabs with separate title and description fields
  • Maintains backward compatibility with existing functionality while using the correct API endpoint
Original prompt

Can you make sure this uses the case creation api?

https://caseapi.phishlabs.com/v1/create/docs/?utm_source=chatgpt.com#/paths/~1caseTypes/get


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: markcoleman <229046+markcoleman@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure integration with case creation API Update PhishLabs integration to use Case Creation API Oct 10, 2025
Copilot AI requested a review from markcoleman October 10, 2025 21:10
Copilot finished work on behalf of markcoleman October 10, 2025 21:10
@markcoleman markcoleman marked this pull request as ready for review October 11, 2025 09:34
Copilot AI review requested due to automatic review settings October 11, 2025 09:34
@markcoleman markcoleman merged commit fe205c7 into main Oct 11, 2025
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the PhishLabs integration to use the official Case Creation API instead of the legacy incident reporting endpoint, aligning with PhishLabs' current API specification.

  • Migrated from legacy incident API to the official Case Creation API (https://caseapi.phishlabs.com/v1/create)
  • Updated API models to match the Case Creation API specification with CaseType, Title, and Description fields
  • Modified service implementation to construct properly formatted case creation requests

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
appsettings.json Updated API base URL and service path to use Case Creation API endpoint
PhishLabsService.cs Modified request construction to include CaseType, Title, and structured Description; updated logging terminology
PhishLabsModels.cs Replaced legacy Url/Timestamp fields with CaseType/Title; renamed IncidentId to CaseId
UnitTest1.cs Updated test configuration and mock responses to match new API structure
UmbracoWeb.Tests.csproj Upgraded Microsoft.Extensions packages to resolve version conflicts
PhishLabsIncidentReporter.md Updated documentation with new API endpoint configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants