Welcome to the documentation for the Samaa Music Streaming App API. This API provides various endpoints to manage users, songs, playlists, and authentication for the Samaa Music Streaming App.
For detailed documentation on how to use the Samaa Music Streaming App API, please visit the Postman API Documentation.
To get started with the API, please follow the instructions below:
-
Sign Up: If you are a new user, sign up using the
/api/users/
endpoint by providing your name, email, password, and gender in the request body. -
Login: After signing up, login to your account using the
/api/login
endpoint by providing your email and password in the request body. -
Accessing Endpoints: Once logged in, you will receive an authentication token (
x-auth-token
). Include this token in the headers of your requests to access authorized endpoints.
- GET
/api/users/:id
: Get user details by ID (authentication required). - PUT
/api/users/:id
: Update user details by ID (authentication required). - GET
/api/users
: Get all users (admin only). - POST
/api/users/
: Sign up a new user.
- POST
/api/songs
: Create a new song (admin only). - PUT
/api/songs/:id
: Update a song by ID (admin only). - DELETE
/api/songs/:id
: Delete a song by ID (admin only). - GET
/api/songs/like/:id
: Get liked songs by user ID (authentication required). - PUT
/api/songs/like/:id
: Like a song by ID (authentication required). - GET
/api/songs/like
: Get all liked songs (authentication required). - GET
/api/songs
: Get all songs. - GET
/api/songs/:id
: Get song details by ID.
- POST
/api/playlists
: Create a new playlist (authentication required). - PUT
/api/playlists/edit/:id
: Update a playlist by ID (authentication required). - GET
/api/playlists/:id
: Get playlist details by ID. - GET
/api/playlists/user-playlists
: Get playlists created by users (authentication required).
- GET
/api/search/?search=:query
: Search for songs or playlists (authentication required). - GET
/api/users/:id/verify/:token
: Verify email for user registration.
Authentication for the API is done using JSON Web Tokens (JWT). Include the x-auth-token
in the headers of your requests to access authorized endpoints. Tokens are obtained by signing up or logging in to the application.
The API returns appropriate HTTP status codes along with error messages in JSON format to indicate the success or failure of a request.
We welcome contributions from the community to enhance and improve the Samaa Music Streaming App API. If you have any suggestions, feedback, or would like to report an issue, please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
We would like to acknowledge the contributions of all developers and contributors who have helped to build and maintain the Samaa Music Streaming App API.
Thank you for using the Samaa Music Streaming App API! Enjoy streaming your favorite music! 🎶🎧
The frontend of the Samaa Music Streaming App is available on GitHub at samaa-frontend. You can check it out to see how the API is integrated into the application.