Skip to main content

Projects

Overview

The Projects API provides a structured and efficient way to manage project-related data, organizing it into projects, sub-projects, and assets. The API follows a hierarchy similar to a blog system with various features.

Endpoints

1. Create a Project

POST /channels/{channelId}/projects

Headers

{
"Accept": "application/json",
"Content-Type": "application/json"
}

Request Body

{
"channelId": "67d32c2c5bbc81bebd000000",
"projectTypeId": "project",
"subTypeId": "music",
"primaryTitle": "Sample Project test create 5!",
"description": "This is a sample project.",
"portraitImg": "https://example.com/portrait.jpg",
"landscapeImg": "https://example.com/landscape.jpg",
"contentUploadType": "serverVideo",
"access": "public",
"status": "published",
"primaryLanguageId": "en",
"categoryId": "music",
"subCategoryId": "rock",
"topicIds": ["topic1", "topic2"],
"supportedFormats": ["audio", "video"],
"supportedModes": ["listen", "watch"],
"supportedFeatures": ["comments", "likeDislikeVotes"]
}

2. Update a Project

PUT /projects/{projectId}

Headers

{
"Accept": "application/json",
"Content-Type": "application/json"
}

Request Body

{
"channelId": "67d32c2c5bbc81bebd000000",
"projectTypeId": "project",
"subTypeId": "music",
"primaryTitle": "Sample Project test update 11",
"description": "This is a sample project.",
"portraitImg": "https://example.com/portrait.jpg",
"landscapeImg": "https://example.com/landscape.jpg",
"contentUploadType": "serverVideo",
"access": "public",
"status": "published",
"primaryLanguageId": "en",
"categoryId": "music",
"subCategoryId": "rock",
"topicIds": ["topic1", "topic2"],
"supportedFormats": ["audio", "video"],
"supportedModes": ["listen", "watch"],
"supportedFeatures": ["comments", "likeDislikeVotes"]
}

3. Delete a Project

DELETE /projects/{projectId}

Headers

{
"Accept": "application/json",
"Content-Type": "application/json"
}

Request Body

N/A

4. Fetch a Project

GET /projects/{project_id}

Headers

{
"Accept": "application/json"
}

Request Body

N/A

Data Types and Validation

Defined Types

ParameterValues
channelIdObjectId as a string (e.g., "67d32c2c5bbc81bebd000000")
projectTypeIdOne of project, show, album, podcasts, playlist
subTypeIdExample: "music"
primaryTitleExample: "Sample Project test create!"
descriptionExample: "This is a sample project."
portraitImgURL string
landscapeImgURL string
contentUploadTypeOne of serverVideo, externalUrl, youtube
accessOne of public, permissions, linkPrivate
statusOne of draft, published, archived
primaryLanguageIdExample: "en"
categoryIdExample: "music"
subCategoryIdExample: "rock"
topicIdsExample: ["topic1", "topic2"]
supportedFormatsOne or more of audio, video, text
supportedModesOne or more of read, listen, watch, chat, go
supportedFeaturesOne or more of comments, remix, like, likeDislikeVotes, polls, download, translate, entTranscribe, voiceover

Verification and Future Considerations

  • Postman Testing:
    • Verified API endpoints:
      • Create a Project
      • Update a Project
      • Fetch a Project
      • Delete a Project
  • Future Work:
    • Ensure only authorized users can create, edit, and delete projects.
    • Validate access restrictions when fetching projects.
    • Implement search functionality with filters.
    • Store search history for user preference data.

Database Schema Updates

  • New Collection: projects
  • MongoDB Schema Template:
{
"channelId": "67d32c2c5bbc81bebd000000",
"projectTypeId": "project",
"subTypeId": "music",
"primaryTitle": "Sample Project test create!",
"description": "This is a sample project.",
"portraitImg": "https://example.com/portrait.jpg",
"landscapeImg": "https://example.com/landscape.jpg",
"contentUploadType": "serverVideo",
"access": "public",
"status": "published",
"primaryLanguageId": "en",
"categoryId": "music",
"subCategoryId": "rock",
"topicIds": ["topic1", "topic2"],
"supportedFormats": ["audio", "video"],
"supportedModes": ["listen", "watch"],
"supportedFeatures": ["comments", "likeDislikeVotes"]
}