Table of Contents

Class ProfileController

Namespace
Builvero.Api.Controllers
Assembly
Builvero.Api.dll

Provides API endpoints for user profile management including retrieval, updates, and management of education, experience, skills, and builder tags.

[ApiController]
[Route("api/profile")]
[Authorize]
public class ProfileController : ControllerBase
Inheritance
ProfileController
Inherited Members

Remarks

All endpoints require authentication (JWT token). Users can only access and modify their own profiles. The controller handles:

  • Profile retrieval and updates
  • Education history management (add, update, delete)
  • Work experience management (add, update, delete)
  • Skills and builder tags management

Profile photo URLs are automatically converted to presigned URLs (15-minute TTL) for secure access.

Constructors

ProfileController(IProfileService)

Initializes a new instance of the ProfileController class.

public ProfileController(IProfileService profileService)

Parameters

profileService IProfileService

Service for profile operations.

Methods

AddEducation(EducationDto, CancellationToken)

Adds a new education entry to the authenticated user's profile.

[HttpPost("me/education")]
public Task<ActionResult<EducationDto>> AddEducation(EducationDto request, CancellationToken cancellationToken)

Parameters

request EducationDto

The education entry to add, containing institution, degree, field of study, dates, etc.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<EducationDto>>

200 OK: Returns the created EducationDto

400 Bad Request: Invalid request data or error updating profile

Remarks

Requires authentication. Adds a new education entry to the user's profile by updating the entire profile. The new education entry is appended to the existing list of education entries.

AddExperience(ExperienceDto, CancellationToken)

Adds a new work experience entry to the authenticated user's profile.

[HttpPost("me/experience")]
public Task<ActionResult<ExperienceDto>> AddExperience(ExperienceDto request, CancellationToken cancellationToken)

Parameters

request ExperienceDto

The experience entry to add, containing company, position, dates, description, etc.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<ExperienceDto>>

200 OK: Returns the created ExperienceDto

400 Bad Request: Invalid request data or error updating profile

Remarks

Requires authentication. Adds a new work experience entry to the user's profile by updating the entire profile. The new experience entry is appended to the existing list of experience entries.

GetEducation(CancellationToken)

Retrieves the authenticated user's education history.

[HttpGet("me/education")]
public Task<ActionResult<List<EducationDto>>> GetEducation(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<List<EducationDto>>>

200 OK: Returns list of EducationDto objects

404 Not Found: User not found

Remarks

Requires authentication. Returns all education entries associated with the authenticated user's profile.

GetExperience(CancellationToken)

Retrieves the authenticated user's work experience history.

[HttpGet("me/experience")]
public Task<ActionResult<List<ExperienceDto>>> GetExperience(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<List<ExperienceDto>>>

200 OK: Returns list of ExperienceDto objects

404 Not Found: User not found

Remarks

Requires authentication. Returns all work experience entries associated with the authenticated user's profile.

GetProfile(CancellationToken)

Retrieves the authenticated user's complete profile information.

[HttpGet("me")]
public Task<ActionResult<ProfileDto>> GetProfile(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<ProfileDto>>

200 OK: Returns ProfileDto with complete profile information

404 Not Found: User not found

Remarks

Requires authentication. Returns the profile for the authenticated user (determined from JWT token). If the user doesn't have a profile yet, returns an empty profile DTO to allow profile completion. Profile photo URLs are automatically converted to presigned URLs.

UpdateProfile(UpdateProfileRequest, CancellationToken)

Updates the authenticated user's profile information.

[HttpPut("me")]
public Task<ActionResult<ProfileDto>> UpdateProfile(UpdateProfileRequest request, CancellationToken cancellationToken)

Parameters

request UpdateProfileRequest

The profile update request containing fields to modify.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<ProfileDto>>

200 OK: Returns updated ProfileDto

400 Bad Request: Invalid request data or validation errors

Remarks

Requires authentication. Performs a full profile update including education, experience, skills, and builder tags. If a profile doesn't exist, it will be created. Profile photo URLs can be updated (supports S3 object keys or external URLs).