Track Details API

GET /api/music/track/{id}

Retrieve detailed information about a specific music track including metadata, file URLs, and categorization.

Endpoint Overview

This endpoint retrieves comprehensive details about a specific music track in the RegardingWork Premium library.

Purpose

Get complete track metadata including title, artist, category, file URL, duration, file size, and activation status. Essential for music player applications that need track information before playback.

Authentication Required

Yes - requires valid JWT token from RegardingWork Hub in Authorization header

Access Control

Users can only access tracks their premium tier allows. FREE tier users have limited access compared to PREMIUM, PREMIUM_PLUS, and PLATINUM tiers.

Quick Reference

Method: GET

URL: /api/music/track/{id}

Auth: Bearer Token

Rate Limit: Standard

Response: JSON

Request Details

URL Structure
GET https://premium.regardingwork.com/api/music/track/{track_id}
Path Parameters
Parameter Type Required Description
track_id Integer Yes Unique identifier for the music track (1-36 for current library)
Headers
Header Value Required Description
Authorization Bearer {jwt_token} Yes Valid JWT token from RegardingWork Hub authentication
Content-Type application/json No Standard content type header

Response Format

Success Response (200 OK)
{
  "id": 1,
  "title": "Deep Focus Alpha Waves",
  "artist": "FocusBeats Studio",
  "category_id": 1,
  "file_url": "https://resources.regardingwork.com/ai-music/ai-deepfocus1-25mins.mp3",
  "duration_seconds": 1500,
  "file_size_mb": 35.9,
  "is_active": true,
  "sort_order": 1,
  "created_at": "2025-08-30T10:15:30Z"
}
Response Fields
Field Type Description
id Integer Unique track identifier
title String Display name of the track
artist String Artist or creator name
category_id Integer Category this track belongs to (1=Intense, 2=Reading, etc.)
file_url String Direct URL to the audio file on CDN
duration_seconds Integer Track length in seconds
file_size_mb Float File size in megabytes
is_active Boolean Whether track is available for playback
sort_order Integer Display order within category
created_at String ISO 8601 timestamp when track was added
Error Responses
401 Unauthorized
{"error": "Invalid or expired token"}
404 Not Found
{"error": "Track not found"}
500 Internal Server Error
{"error": "Internal server error"}

Implementation Examples

JavaScript (Fetch API)
// Get track details
async function getTrackDetails(trackId, authToken) {
  const response = await fetch(`https://premium.regardingwork.com/api/music/track/${trackId}`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${authToken}`,
      'Content-Type': 'application/json'
    }
  });
  
  if (response.ok) {
    const trackData = await response.json();
    console.log('Track details:', trackData);
    return trackData;
  } else {
    throw new Error(`Failed to get track details: ${response.status}`);
  }
}
Swift (iOS/macOS)
func getTrackDetails(trackId: Int, authToken: String) async throws -> TrackDetails {
    let url = URL(string: "https://premium.regardingwork.com/api/music/track/\(trackId)")!
    
    var request = URLRequest(url: url)
    request.httpMethod = "GET"
    request.setValue("Bearer \(authToken)", forHTTPHeaderField: "Authorization")
    request.setValue("application/json", forHTTPHeaderField: "Content-Type")
    
    let (data, response) = try await URLSession.shared.data(for: request)
    
    guard let httpResponse = response as? HTTPURLResponse,
          httpResponse.statusCode == 200 else {
        throw APIError.requestFailed
    }
    
    return try JSONDecoder().decode(TrackDetails.self, from: data)
}
Python (requests)
import requests

def get_track_details(track_id: int, auth_token: str) -> dict:
    """Get track details from RegardingWork Premium API"""
    url = f"https://premium.regardingwork.com/api/music/track/{track_id}"
    
    headers = {
        "Authorization": f"Bearer {auth_token}",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    
    if response.status_code == 200:
        return response.json()
    else:
        response.raise_for_status()

# Usage example
track_data = get_track_details(track_id=1, auth_token="your_jwt_token")
print(f"Track: {track_data['title']} by {track_data['artist']}")
cURL Command
curl -X GET "https://premium.regardingwork.com/api/music/track/1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"
Related Endpoints
Documentation

← Back to API Documentation

Support

For integration support, contact the RegardingWork development team.