Fetch Documentation

Retrieve published documentation articles with pagination and search capabilities.

POST /documentation/fetch

Description

This endpoint retrieves published documentation articles with support for pagination and full-text search. Results are returned in pages of 5 documents by default, including the full content (Description field). You can search across document titles and content to find specific information.

Request Body Parameters

Parameter Type Required Default Description
page Number No 1 Page number to retrieve
limit Number No 5 Number of documents per page (max: 10)
search String No null Search term to filter documents by title or content

Authentication

This endpoint requires Bearer token authentication via the Authorization header.

Code Examples

curl -X POST "https://api-v3.sweeppea.com/documentation/fetch" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "page": 1, "limit": 5, "search": "API" }'

Response

200 OK

{ "Response": true, "Data": { "TotalDocuments": 245, "CurrentPage": 1, "TotalPages": 49, "Limit": 5, "HasNextPage": true, "HasPrevPage": false, "Documents": [ { "_id": "68df07e9896a685bf51d58cf", "DocumentToken": "uuid-v4-string", "DocumentTitle": "Getting Started with Sweeppea API", "Description": "Full documentation content here...", "Language": "EN", "Module": "API", "Keywords": "api, getting started, authentication", "ResourceAffected": "api", "Files": [], "Views": 150, "Score": [], "Status": true, "CreationDate": "2025-01-15T10:30:00.000Z", "LastUpdate": "2025-01-20T14:45:00.000Z" } ] } }

Response Fields

Field Type Description
TotalDocuments Number Total number of documentation articles matching the query
CurrentPage Number Current page number
TotalPages Number Total number of pages available
Limit Number Number of documents per page
HasNextPage Boolean Whether there is a next page available
HasPrevPage Boolean Whether there is a previous page available
DocumentToken String Unique identifier for the documentation article (UUID v4)
DocumentTitle String Title of the documentation article
Description String Full content of the documentation article
Language String Language code (e.g., "EN", "ES")
Module String Module or category the documentation belongs to
Keywords String Comma-separated keywords for search optimization
ResourceAffected String Resource type (renaissance, overture, api, etc.)
Views Number Number of times the documentation has been viewed

Error Responses

401 Unauthorized

{ "Response": false, "Message": "Invalid or Missing Bearer Token", "Code": 401 }

403 Forbidden

{ "Response": false, "Message": "Invalid API Token", "Code": 403 }

404 Not Found

{ "Response": false, "Message": "User Not Found", "Code": 404 }

500 Internal Server Error

{ "Response": false, "Message": "Internal Server Error", "Code": 500 }

Notes

  • Pagination: Results are returned in pages of 5 documents by default. Use page and limit parameters to navigate through results. Maximum limit is 10 documents per page.
  • Full Content: The Description field containing the full documentation content is included in all responses.
  • Search: Use the search parameter to filter documents by title or content. Search is case-insensitive and supports partial matches.
  • Sorting: Documents are sorted by creation date in descending order (newest first).
  • Navigation: Use HasNextPage and HasPrevPage to determine if more pages are available.

Usage Examples

Fetch First Page
{ "page": 1, "limit": 5 }
Search for Specific Topic
{ "search": "authentication", "page": 1, "limit": 5 }
Get More Results Per Page
{ "page": 1, "limit": 10 }