条形码
GET https://www.pmq.net/api/barcodes/
curl --request GET \
--url 'https://www.pmq.net/api/barcodes/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.pmq.net/api/barcodes/' \
--header 'Authorization: Bearer {api_key}' \
| 参数 | 详情 | 描述 |
|---|---|---|
| search | 可选 字符串 | 搜索字符串。 |
| search_by | 可选 字符串 | 您要按哪个字段进行搜索?允许的值包括: name, value. |
| type | 可选 字符串 | 允许的值: C32, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, ITF14, C128, C128A, C128B, C128C, EAN2, EAN5, EAN8, EAN13, UPCA, UPCE, MSI, MSI+, POSTNET, PLANET, TELEPENALPHA, TELEPENNUMERIC, RMS4CC, KIX, IMB, CODABAR, CODE11, PHARMA, PHARMA2T |
| datetime_field | 可选 字符串 | 允许的值: datetime, last_datetime |
| datetime_start | 可选 字符串 | 筛选从此日期时间开始的结果。请使用Y-m-d H:i:s格式。 |
| datetime_end | 可选 字符串 | 筛选截至此日期时间的结果。请使用Y-m-d H:i:s格式。 |
| order_by | 可选 字符串 | 按哪个字段对结果进行排序。允许的值包括: barcode_id, datetime, last_datetime, name, type. |
| order_type | 可选 字符串 | 结果的排序方式。允许的值为: ASC(升序)DESC(降序). |
| page | 可选 整数 | 您想要获取结果的页码。默认值为1. |
| results_per_page | 可选 整数 | 每页显示多少条结果。允许的值包括: 10, 25, 50, 100, 250, 500, 1000. 默认值为25. |
{
"data": [
{
"id": 1,
"type": "C32",
"name": "Example name",
"value": "123456",
"barcode": "https://www.pmq.net/uploads/barcode/example.svg",
"settings": {
"foreground_color": "#000000",
"width_scale": 2,
"height": 50,
},
"embedded_data": "123456",
"last_datetime": null,
"datetime": "2026-05-12 14:11:35",
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://www.pmq.net/api/barcodes?page=1",
"last": "https://www.pmq.net/api/barcodes?page=1",
"next": null,
"prev": null,
"self": "https://www.pmq.net/api/barcodes?page=1"
}
}
GET https://www.pmq.net/api/barcodes/{barcode_id}
curl --request GET \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"type": "C32",
"name": "Example name",
"value": "123456",
"barcode": "https://www.pmq.net/uploads/barcode/example.svg",
"settings": {
"foreground_color": "#000000",
"width_scale": 2,
"height": 50,
},
"embedded_data": "123456",
"last_datetime": null,
"datetime": "2026-05-12 14:11:35",
}
}
POST https://www.pmq.net/api/barcodes
| 参数 | 详情 | 描述 |
|---|---|---|
| project_id | 可选 整数 | - |
| name | 必填 字符串 | - |
| type | 必填 字符串 | 允许的值: C32, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, ITF14, C128, C128A, C128B, C128C, EAN2, EAN5, EAN8, EAN13, UPCA, UPCE, MSI, MSI+, POSTNET, PLANET, TELEPENALPHA, TELEPENNUMERIC, RMS4CC, KIX, IMB, CODABAR, CODE11, PHARMA, PHARMA2T |
| is_bulk | 可选 布尔值 | |
| value | 必填 字符串 | - |
| display_text | 可选 布尔值 | - |
| foreground_color | 可选 字符串 | - |
| background_color | 可选 字符串 | - |
| width_scale | 可选 整数 | 1-10 |
| height | 可选 整数 | 30-1000 |
| 参数 | 详情 | 描述 |
|---|---|---|
curl --request POST \
--url 'https://www.pmq.net/api/barcodes' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=New York' \
--form 'type=text' \
--form 'text=Hello!' \
--url 'https://www.pmq.net/api/barcodes' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=New York' \
--form 'type=text' \
--form 'text=Hello!' \
{
"data": {
"id": 1
}
}
POST https://www.pmq.net/api/barcodes/{barcode_id}
| 参数 | 详情 | 描述 |
|---|---|---|
| project_id | 可选 字符串 | - |
| name | 可选 字符串 | - |
| type | 可选 字符串 | 允许的值: C32, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, ITF14, C128, C128A, C128B, C128C, EAN2, EAN5, EAN8, EAN13, UPCA, UPCE, MSI, MSI+, POSTNET, PLANET, TELEPENALPHA, TELEPENNUMERIC, RMS4CC, KIX, IMB, CODABAR, CODE11, PHARMA, PHARMA2T |
| value | 必填 字符串 | - |
| display_text | 可选 布尔值 | - |
| foreground_color | 可选 字符串 | - |
| background_color | 可选 字符串 | - |
| width_scale | 可选 整数 | 1-10 |
| height | 可选 整数 | 30-1000 |
curl --request POST \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Las Vegas' \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Las Vegas' \
{
"data": {
"id": 1
}
}
DELETE https://www.pmq.net/api/barcodes/{barcode_id}
curl --request DELETE \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.pmq.net/api/barcodes/{barcode_id}' \
--header 'Authorization: Bearer {api_key}' \