Skip to main content

Get News List

This API lets you retrieve the list of news articles created in your shop, with support for pagination and search by title.


Endpoint

🔗Endpoint Staging

http GET https://staging-manage.api.miniai.vn/api/external/news

🔗Endpoint Production

http GET https://manage-api.miniap.vn/api/external/news

A note on the path

The news API sits directly under /api/external/news, without the /v1 prefix used by the product and order APIs.

Authentication

Every request must include your API key in the header:

HeaderValueRequired
x-api-keyminiai-partner <YOUR_API_KEY>Bắt buộc
No need to send shopId

The system automatically determines your shop (shopId) from your API key and assigns it to the request. So you don't need to send shopId in the query. If you do send it, that value will be overwritten with the shop matching your API key — the result always contains only your shop's news.

Query Parameters

All parameters are optional.

ParameterTypeRequiredDefaultDescription
pagenumberTùy chọn1Page to fetch, integer ≥ 1.
limitnumberTùy chọn10Articles per page, from 1 up to a maximum of 50.
searchstringTùy chọnSearch by title — partial, case-insensitive match.
sortBystringTùy chọnAccepted but ignored (see note below).
sortTypestringTùy chọnasc or desc. Accepted but ignored.
filtersstringTùy chọnAccepted but ignored.
Fixed sort order

The list is always sorted by creation time, newest first (createdAt descending). The sortBy, sortType, and filters parameters are currently accepted for compatibility but have no effect on the result.

Category filtering is not supported

This API's query does not accept categoryId. Sending it returns a 400 error (e.g. "categoryId" is not allowed).

Example Request

curl -X GET 'https://staging-manage.api.miniai.vn/api/external/news?page=1&limit=10&search=khuy%E1%BA%BFn%20m%C3%A3i' \
-H 'x-api-key: miniai-partner <YOUR_API_KEY>'

Response

Success returns 200. The article list is in data.news, pagination info is in data.meta.

{
"success": true,
"data": {
"news": [
{
"_id": "68c93dba802d36826bc45c9c",
"type": "news",
"title": "October Promotion",
"slug": "october-promotion",
"shortContent": "50% off everything from 10/01 to 10/31.",
"content": "<p>50% off <strong>everything</strong> from 10/01 to 10/31.</p>",
"status": "active",
"shopId": "64204a17a5a97a86f12e1f0a",
"images": [
"https://dmcl0k8mc5oht.cloudfront.net/64204a17a5a97a86f12e1f0a/e888246f-2647-42f1-9d89-53eacdb7bf64.webp"
],
"cta": [
{
"name": "Buy now",
"url": "https://zalo.me/s/1234567890/products"
}
],
"itemIds": [
"68c93dba802d36826bc45d01"
],
"items": [
{
"_id": "68c93dba802d36826bc45d01",
"name": "Product name",
"price": 20000,
"images": [
"https://dmcl0k8mc5oht.cloudfront.net/64204a17a5a97a86f12e1f0a/e888246f-2647-42f1-9d89-53eacdb7bf64.webp"
],
"slug": "product-name",
"id": "68c93dba802d36826bc45d01"
}
],
"createdAt": "2025-09-16T10:36:42.809Z",
"updatedAt": "2025-09-16T10:36:42.809Z",
"__v": 0,
"id": "68c93dba802d36826bc45c9c"
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 1
}
}
}

Fields in data.news[]

FieldTypeDescription
id / _idstringNews article ID — used for update, delete, and product-linking APIs
typestringAlways news
titlestringArticle title
slugstringFriendly URL path, unique per shop
shortContentstringAuto-generated summary from the content
contentstringFull HTML content
statusstringactive or inactive
shopIdstringShop ID
imagesstring[]List of image URLs
ctaobject[]List of call-to-action buttons (name, url)
itemIdsstring[]List of related product IDs
itemsobject[]Related products with details: name, price, images, slug
createdAtstringCreation time (ISO 8601)
updatedAtstringLast update time (ISO 8601)

Fields in data.meta

FieldTypeDescription
pagenumberCurrent page
limitnumberArticles per page
totalnumberTotal number of articles matching the query (across all pages)
Calculating total pages

Total pages = Math.ceil(meta.total / meta.limit). Loop page from 1 to this value to fetch all news.

Common Errors

CodeCause
400Wrong parameter type (page/limit not a number), limit exceeds 50, sortType not asc/desc, or a disallowed parameter was sent (e.g. categoryId)
401Missing x-api-key header, wrong miniai-partner prefix, or invalid API key
429Rate limit exceeded (see the Rate Limit section below)
500System error
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation failed",
"validation": {
"query": {
"source": "query",
"keys": ["limit"],
"message": "\"limit\" must be less than or equal to 50"
}
}
}

Rate Limit

100 requests / minute

Each shop can make at most 100 requests per minute across the entire External API. Exceeding this limit returns a 429 status.

Next Steps

With the id of each article in the list, you can: