Create auto publish

This endpoint creates new auto publish.

URL : /config/auto-publish/add

Method : POST

X-HMAC required : YES

Request Body Parameters :

interface AutoPublish {
    type: ALL | CUSTOMER;
    period: DAILY | MONTHLY | WEEKLY;
    time: number;
    customerId?: string;
    pendingLimit?: number;
}

Response

The response will be a JSON object containing created auto publish.

interface AutoPublish {
    id: number;
    type: ALL | CUSTOMER;
    period: DAILY | MONTHLY | WEEKLY;
    time: number;
    customerId?: string;
    pendingLimit?: number;
    createdAt: Date;
    lastExec?: Date;
    error?: boolean;
}

Status Codes

The endpoint will return the following status codes based on the operation outcome:

  • 200OK: The request was successful.
  • 400Bad Request: No data are published.
  • 500Internal Server Error: An error occurred on the server while processing the request.

Example Request

POST /config/auto-publish/add HTTP/1.1
Content-Type: application/json
Host: localhost:3000
X-HMAC: 5d41402abc4b2a76b9719d911017c592
{
    "type": "CUSTOMER",
    "period": "MONTHLY",
    "time": 4,
    "customerId": "2",
    "pendingLimit": 10,
}

Example Response

{
    "id": 6,
    "type": "CUSTOMER",
    "period": "MONTHLY",
    "time": 4,
    "customerId": "2",
    "pendingLimit": 10,
    "createdAt": "2024-03-13T11:41:40.087Z",
    "lastExec": null,
    "error": null
}