Skip to content

Resource Download

Interfaces for getting downloadable resource lists.

Get Resource List

Get all public resources.

Interface Information

  • Endpoint: GET /api/resources
  • Authentication: Not required (public interface)

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number, default 1
limitnumberNoItems per page, default 10

Download Resource

Download a specific resource and increment download count.

Interface Information

  • Endpoint: GET /api/resources/:id/download
  • Authentication: Not required (public interface)

Path Parameters

ParameterTypeRequiredDescription
idnumberYesResource ID

Request Examples

bash
# Get resource list
curl http://localhost:3000/api/resources

# Download resource (redirects to actual file)
curl -L http://localhost:3000/api/resources/1/download

Response Example (Resource List)

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Project Template",
      "description": "Quick start template",
      "fileSize": "5.2MB",
      "downloadCount": 128,
      "createdAt": "2024-01-15T10:00:00.000Z"
    }
  ],
  "total": 10,
  "page": 1,
  "limit": 10
}

Error Responses

HTTP Status CodeDescription
404Resource does not exist
500Server error