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
Parameter | Values |
---|---|
channelId | ObjectId as a string (e.g., "67d32c2c5bbc81bebd000000") |
projectTypeId | One of project , show , album , podcasts , playlist |
subTypeId | Example: "music" |
primaryTitle | Example: "Sample Project test create!" |
description | Example: "This is a sample project." |
portraitImg | URL string |
landscapeImg | URL string |
contentUploadType | One of serverVideo , externalUrl , youtube |
access | One of public , permissions , linkPrivate |
status | One of draft , published , archived |
primaryLanguageId | Example: "en" |
categoryId | Example: "music" |
subCategoryId | Example: "rock" |
topicIds | Example: ["topic1", "topic2"] |
supportedFormats | One or more of audio , video , text |
supportedModes | One or more of read , listen , watch , chat , go |
supportedFeatures | One 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
- Verified API endpoints:
- 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"]
}