π API Endpoints
β° Task Management
Scheduled task and cron job management endpoints. 6 endpoints available.
π― Quick Stats
- Total Endpoints: 6
- Base URL:
https://api.market.decenctype.com - Authentication: Bearer Token / API Key
π Methods
- π GET: 3 endpoints
- π POST: 1 endpoints
- βοΈ PUT: 2 endpoints
π Authentication
All endpoints in this section use the same authentication methods. Choose one:
π Bearer Token (Recommended)
For user session authentication
Add to request headers:
Authorization: Bearer YOUR_TOKENπ§ API Key
For server-side authentication
Add to request headers:
X-API-KEY: YOUR_API_KEYβ οΈ Important: Do not use both authentication methods simultaneously in the same request.
π Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
π GET | /task/cron | No description |
π POST | /task | Create a new task |
π GET | /task | Get all tasks |
π GET | /task/{taskId} | No description |
βοΈ PUT | /task/{taskId}/suspend | No description |
βοΈ PUT | /task/{taskId}/resume | No description |
π Detailed Documentation
GET /task/cron
GET
/task/cronFull URL
https://api.market.decenctype.com/task/cronπ Authentication: Required (see authentication section above)
Operation ID: listCronJobs
Response Status:
- β 200: Success
π Example Request
curl -X GET "https://api.market.decenctype.com/task/cron" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"Create a new task
POST
/taskFull URL
https://api.market.decenctype.com/taskDescription: Create a new task
Operation ID: createTask
Response Status:
- β 201: Task created successfully
π Response Examples
response.json
1{2 "id": 1,3 "name": "daily-task",4 "description": "This is a daily task",5 "cron": "0 0 * * *",6 "active": true,7 "payload": {8 "key": "value"9 },10 "maxRetries": 3,11 "retryDelay": 3000012}π Example Request
curl -X POST "https://api.market.decenctype.com/task" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{}'Get all tasks
GET
/taskFull URL
https://api.market.decenctype.com/taskπ Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
current | number | β | No description |
pageSize | number | β | No description |
Description: Get all tasks
Operation ID: getAllTasks
Response Status:
- β 200: List of tasks
π Response Examples
response.json
1{2 "items": [3 {4 "id": 1,5 "name": "η€ΊδΎδ»»ε‘",6 "description": "θΏζ―δΈδΈͺη€ΊδΎδ»»ε‘ζθΏ°",7 "cron": "0 0 0 * * *",8 "active": true,9 "createdAt": "2023-06-29T00:00:00.000Z"10 }11 ],12 "total": 100,13 "current": 1,14 "pageSize": 1015}π Example Request
curl -X GET "https://api.market.decenctype.com/task" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"GET /task/{taskId}
GET
/task/{taskId}Full URL
https://api.market.decenctype.com/task/{taskId}π― Path Parameters
taskId(number) - β Required: No description
Operation ID: findOne
Response Status:
- β 200: Success
π Response Examples
response.json
1{2 "id": 1,3 "name": "daily-task",4 "description": "This is a daily task",5 "cron": "0 0 * * *",6 "active": true,7 "payload": {8 "key": "value"9 },10 "maxRetries": 3,11 "retryDelay": 3000012}π Example Request
curl -X GET "https://api.market.decenctype.com/task/example-id" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"PUT /task/{taskId}/suspend
PUT
/task/{taskId}/suspendFull URL
https://api.market.decenctype.com/task/{taskId}/suspendπ― Path Parameters
taskId(number) - β Required: No description
Operation ID: suspend
Response Status:
- β 200: Success
π Example Request
curl -X PUT "https://api.market.decenctype.com/task/example-id/suspend" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"PUT /task/{taskId}/resume
PUT
/task/{taskId}/resumeFull URL
https://api.market.decenctype.com/task/{taskId}/resumeπ― Path Parameters
taskId(number) - β Required: No description
Operation ID: resume
Response Status:
- β 200: Success
π Example Request
curl -X PUT "https://api.market.decenctype.com/task/example-id/resume" \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json"