跳转到主要内容

API 文档

David Andrade avatar
作者:David Andrade
超过 2 周前更新

API 基 URI 端点

所有 API 调用的端点均为:https://app.prodsmart.com/

身份验证

Prodsmart API 使用简单的令牌授权。首先,您应创建一个新令牌(或获取一个现有令牌)。获取令牌后,您可以使用它来访问令牌作用域内的其他资源。

您的身份验证令牌有效期为 2 小时,之后您必须使用 API 凭据请求一个新令牌。

介质类型

具有消息主体的请求使用纯文本 JSON 来设置或更新资源状态。

错误状态

使用常见的 HTTP 响应状态代码。

JSON 无效

如果您获得一条指出“JSON 无效”的响应,请验证在 JSONLint 上使用的 json 有效负载。

速率限制

API 请求限制为每个公司每分钟 120 个请求。超过限制后,后续请求将获得 HTTP 状态代码 429“请求过多”的响应。

此外,消息头将显示您在重试请求之前必须等待多少秒:

Retry-After: <delay-seconds>

应对速率限制的最佳实践:

  • 在一段时间内均匀地分布请求,以避免可能会导致响应受限的使用高峰

  • 开发使用“Retry-After”信息了解何时可以重试请求的逻辑

  • 确保没有不必要的集成并行运行,因为所有集成都会计入限制

日期格式

API 日期字段格式遵循 ISO 8601 的表示形式:

  • YYYY-MM-DDThh:mm:ssZ

在此格式中,字母 T 用作必需的分隔符,而 Z 是时区标志符(如果需要)。如果不使用 Z,则应用于日期的时区与在 Prodsmart 公司中设置的时区相同。Z 表示零时区,因为它的偏移量为 0。

用法示例:

  • 如果使用的时间比 UTC 早一小时,则时区标志符应为“+01:00”、“+0100”或简单的“+01”。

  • 如果公司时区设置为 -05:00 且发送的日期格式为 2020-07-20T09:15:15Z,则日期将在 Prodsmart 中显示为 07/20/2020 - 04:15:15。

  • 如果发送的格式为 2020-07-20T09:15:15,则日期将在 Prodsmart 中显示为 07/20/2020 - 09:15:15(时区为 -05:00),这意味着,如果用户的时区设置为 -04:00,则日期将显示为 07/20/2020 - 10:15:15。


常见 ERP 集成

ERP 集成的常见场景主要是生产订单、库存和产品目录的同步。

生产订单

在 ERP 端创建生产订单时,ERP 应使用生产订单创建服务将 JSON 格式的生产订单数据发送到 Prodsmart 的 API。如果在 Prodsmart 上创建或更新生产订单时需要更新 ERP 端,有两种可能性:可以从外部联系 ERP,在这种情况下,可以在 Prodsmart 上设置 Webhook,在 Prodsmart 端创建、更新和删除生产订单时将会调用 Webhook。如果无法从外部联系 ERP,则 ERP 必须主动轮询生产订单列表服务以检测更改。

库存

通常,ERP(或 WMS)是库存的主控系统,因此我们提供了一项服务(更新产品库存),允许 ERP/WMS 将产品的当前库存更新为特定数量。有时,可以通知 ERP/WMS 生产库存变动,方法是通过观察生产订单的变化,或者使用 Webhook 或当前的库存 Web 服务(根据请求)。

产品

产品目录也会同步,只是不那么频繁。在这种情况下,ERP 始终是主控系统,它可以使用产品创建服务来创建产品和操作。


Webhook

Webhook 可用于应用程序的集成菜单中的生产订单事件。为了使用此功能,请向要侦听的通知事件添加端点 URL 回调。我们力求在系统中发生事件时尽快发送 Webhook 通知。如果同时更改了大量的生产订单,可能会在很短的一段时间内传送大量的通知。当前,我们不支持任何重试。

标头

Webhook 标头

x-prodsmart-topic: "productionOrder/create"x-prodsmart-hmac-sha256: "c938fe31379c0d89b37468e1cae9e3aab2d56834"x-prodsmart-api-version: "1"x-prodsmart-webhook-uuid: "91cb972d-b476-4936-947c-4be471b9da5b"x-prodsmart-triggered-at: "2023-08-29T20:39:46.142Z"

注意

  • x-prodsmart-topic - 标识 Webhook 的主题

  • x-prodsmart-hmac-sha256 - 用于验证 Webhook 的起源

  • x-prodsmart-api-version - 用于发送 Webhook 的 API 版本

  • x-prodsmart-webhook-uuid - 标识唯一的 Webhook

  • x-prodsmart-triggered-at - 触发 Webhook 的时间

如何验证 Webhook?

  • 在使用 200 状态代码进行响应之前,务必确认 Webhook 来源于 Prodsmart。这种验证是通过计算签名来实现的。

  • 每个 Webhook 请求都附带一个名为 x-prodsmart-hmac-sha1 的特定标头,它以 base64 格式进行了编码。此标头是使用 API 密钥和 Webhook 请求中包含的数据生成的。

  • 为了验证 Webhook 的真实性,您需要使用相同的 API 密钥和提供的数据自行计算签名。

  • 计算出签名后,将其与在传入 Webhook 请求的 x-prodsmart-hmac-sha1 标头中找到的值进行比较。

  • 如果计算出的签名与 x-prodsmart-hmac-sha1 标头中的值匹配,您可以确信 Webhook 确实是从 Prodsmart 发送的,可以继续使用 200 状态代码对其进行响应。

生产订单

  • 请求 (application/json)

    • 方法:POST

    • 主体

{    "products": [        {            "product": "V23076",            "quantity-ordered": 3500,            "observations": "",            "quantity-produced": 700        }    ],    "code": "Test Production Order",    "shipping": {        "code": "shipping 45"    },    "serial-number": "",    "description": "",    "start-date": "2023-04-20T09:15:15Z",    "due-date": "2023-05-16T17:15:15Z",    "workers-assigned": [        {            "number": 120        },        {            "number": 11        },        {            "number": 10        },        {            "number": 1        }    ],    "ended": false,    "machines": [        {            "code": "A32"        },        {            "code": "F1"        }    ],    "pieces-by-box": 20,    "status": "onschedule",    "running-status": "started",    "notes": "",    "id": 1}

注意:删除生产订单后,将删除 running-status。

打卡机

  • 请求 (application/json)

    • 方法:POST

    • 主体

{    "id": 932015,    "date": "2022-05-19T14:35:30.000+01:00",    "notification": "punchClock_created",    "worker": {        "number": 0    },    "entry": 1}

  • entry 可能的值:

    • 1 - 入

    • 0 - 出

  • notification 可能的值:

    • punchClock_created

    • punchClock_updated

    • punchClock_deleted

发货库存移动

已创建/已更新发货库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

[{    "product": {        "id": 222,        "code": "product-code",        "uom": "uom"    },    "lot": {        "code": "lot-code",        "expiration-date": "lot-expiration-date",        "supplier-lot": "supplier-lot-name"    },    "date": "2022-02-21T00:00:00Z",    "quantity": 10.0,    "stock-type": "out",    "comment": "comment",    "warehouse-location": {        "id": 333,        "code": "warehouse-location-code",        "warehouse": {            "id": 444,            "code": "warehouse-code"        }    },    "sales-order": {        "id": 555,        "code": "sales-order-code",        "client": {            "id": 777,            "code": "client-code"        },        "parameters": [{            "name": "parameterX",            "value": "valueX"        }]    },    "shipping": {        "id": 666,        "code": "shipping-code"    },    "worker": {        "id": 333,        "number": 0,        "name": "worker-name"    }}]

  • notification 可能的值:

    • shipping_inventory_movement_created

    • shipping_inventory_movement_updated

已删除发货库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 111}

  • notification 可能的值:

    • shipping_inventory_movement_deleted

收货库存移动

已创建/已更新收货库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

[{    "product": {        "id": 222,        "code": "product-code",        "uom": "uom"    },    "lot": {        "code": "lot-code",        "expiration-date": "lot-expiration-date",        "supplier-lot": "supplier-lot-name"    },    "date": "2022-02-21T00:00:00Z",    "quantity": 10.0,    "stock-type": "in",    "comment": "comment",    "warehouse-location": {        "id": 333,        "code": "warehouse-location-code",        "warehouse": {            "id": 444,            "code": "warehouse-code"        }    },    "purchase-order": {        "id": 555,        "code": "purchase-order-code",        "supplier": "supplier-code",        "parameters": [{            "name": "parameterX",            "value": "valueX"        }]    },    "receiving": {        "id": 666,        "code": "receiving-code"    },    "worker": {        "id": 333,        "number": 0,        "name": "worker-name"    }}]

  • notification 可能的值:

    • receiving_inventory_movement_created

    • receiving_inventory_movement_updated

已删除收货库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 111}

  • notification 可能的值:

    • receiving_inventory_movement_deleted

内部库存移动

已创建/已更新内部库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

[{    "product": {        "id": 222,        "code": "product-code",        "uom": "uom"    },    "lot": {        "code": "lot-code",        "expiration-date": "lot-expiration-date",        "supplier-lot": "supplier-lot-name"    },    "date": "2022-02-21T00:00:00Z",    "quantity": 10.0,    "stock-type": "in",    "comment": "comment",    "warehouse-location": {        "id": 333,        "code": "warehouse-location-code",        "warehouse": {            "id": 444,            "code": "warehouse-code"        }    },    "worker": {        "id": 333,        "number": 0,        "name": "worker-name"    }}]

  • notification 可能的值:

    • internal_inventory_movement_created

    • internal_inventory_movement_updated

已删除内部库存移动

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 111}

  • notification 可能的值:

    • internal_inventory_movement_deleted

材料暂存移动

已创建/已更新材料暂存

  • 请求 (application/json)

    • 方法:POST

    • 主体

[{    "product": {        "id": 222,        "code": "product-code",        "uom": "uom"    },    "production-order": {        "id": 333,        "code": "production-order-code"    },    "lot": {        "code": "lot-code",        "expiration-date": "lot-expiration-date",        "supplier-lot": "supplier-lot-name"    },    "date": "2022-02-21T00:00:00Z",    "quantity": 10.0,    "warehouse-location": {        "id": 333,        "code": "warehouse-location-code",        "warehouse": {            "id": 444,            "code": "warehouse-code"        }    },    "worker": {        "id": 333,        "number": 0,        "name": "worker-name"    }}]

  • notification 可能的值:

    • material_staging_created

    • material_staging_updated

已删除材料暂存

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 111}

  • notification 可能的值:

    • material_staging_deleted

批次

已创建/已更新批次

  • 请求 (application/json)

    • 方法:POST

    • 主体

[{    "code": "lot-code",    "creation-date": "2022-02-21T00:00:00Z",    "expiration-date": "2022-02-21T00:00:00Z",    "supplier-lot": "supplier-lot-name",    "product": {        "id": 222,        "code": "product-code",        "uom": "uom"    }}]

  • notification 可能的值:

    • lot_created

    • lot_updated

已删除批次

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 111}

  • notification 可能的值:

    • lot_deleted

停工期

已创建/已更新/已删除停工期

  • 请求 (application/json)

    • 方法:POST

    • 主体

{  "id": 1,  "start-time": "2000-01-01T00:00:00.000+01:00",  "end-time": "2099-12-31T23:59:59.999+01:00",  "started-by": {},  "closed-by": {    "number": 0  },  "workers": [    {      "number": 0    }  ],  "machines": [],  "product": "",  "production-order": "",  "checked-out": true,  "downtime-type": "downtime1 type",  "time-spent": "08:00:00",  "event-type": "downTime_created"}

  • notification 可能的值:

    • downTime_created

    • downTime_updated

    • downTime_deleted

更改馈送通道

如果由于任何原因您无法使用 Webhook,我们目前提供了一种替代方法,即更改堆栈,它将存储在过去 24 小时内或自您上次通过我们提供的 Web 服务请求更改以来发生的更改。若要使用此功能,您必须在集成菜单 (https://app.prodsmart.com/admin/integrations) 中创建通道。您最多可以为每个组织创建 3 个通道。

有 6 种类型的更改通道:

  • DOWN_TIME

  • PRODUCT

  • PRODUCTION

  • PRODUCTION_ORDER

  • PUNCH_CLOCK

  • STOCK

获取更改

GET /api/changes/{channel}{?access_token}

调用此服务时,您将获得已更改的实体列表,这些实体发生更改是因为已创建/已更新/已删除它们或其状态发生了变化。您将收到一个数组,其中包含实体的当前状态(排列顺序是从最早的更改到最新的更改),每次调用服务最多收到 25 个。从该服务获取的实体将从堆栈中移除(直到它们有了新的更新)。如果没有更改,该服务将返回空数组(“[]”)。

示例 URI

GET /api/changes/channel?access_token=

URI 参数

channel

字符串(必需)

要访问的通道

access_token

字符串(必需)

Prodsmart API 访问令牌。

workers

布尔值(可选)

显示生产订单通道响应的工人列表

请求

Content-Type: application/json

DOWNTIMES

[    {        "id": 1435048,        "start-time": "2022-04-22T14:47:00.000+01:00",        "end-time": "2022-04-23T00:00:00.000+01:00",        "started-by": {},        "closed-by": {            "number": 1        },        "workers": [            {                "number": 1            }        ],        "machines": [],        "product": "",        "production-order": "",        "checked-out": true,        "downtime-type": "Maintenance",        "time-spent": "09:13:00",        "event-type": "downTime_deleted",    }]

注意:只有在删除停工期后,event-type 字段才会出现。

PRODUCTION ORDERS

[    {        "products": [            {                "product": "RN2",                "quantity-ordered": 30.0,                "observations": "",                "quantity-produced": 0.0            }        ],        "code": "Production Order 123",        "description": "",        "shipping": {},        "start-date": "2022-04-21T00:00:00.000+01:00",        "due-date": "2022-04-28T00:00:00.000+01:00",        "ended": false,        "machines": [],        "notes": "",        "is-active": true,        "running-status": "notstarted",        "status": "onschedule",        "material-staging-complete": false,        "id": 1379919    }]

注意:删除生产订单后,running-status 字段的值将为 deleted。

PRODUCTS

[    {        "code": "V23076",        "name": "V23076",        "observations": "",        "section": null,        "unit-cost": null,        "unit-price": null,        "families": [],        "operations": [],        "components": [],        "custom-fields": [],        "notification": null,        "serializable": null,        "shipping-package-types": [],        "external-stock": null,        "stock-max": null,        "min-quantity-reorder": null,        "quantity-multiple": null,        "scrap-allowance": null,        "shelf-life": null,        "parameters": []    }]

注意:删除产品后,notification 字段的值将为 product_deleted。

PRODUCTION RECORDS ¶

[    {        "production-order": {            "code": "P1 - Week 14",            "id": 3641        },        "operation": {            "code": "CUT3",            "product": "P1"        },        "worker": {            "number": 6        },        "machine": {            "code": "WJC"        },        "quantity": 0.0,        "checked-out": false,        "produced-waste": [],        "consumptions": [],        "total-time-factor": 1.0,        "rework": false,        "work-time": "00H00m00s",        "start-time": "2022-04-22T14:43:00.000+01:00",        "end-time": "2022-04-22T14:43:00.000+01:00",        "status": "deleted",        "show-check-in-checklist-and-c-f": false,        "id": 12952533    }]

注意:只有在删除生产记录后,status 字段才会出现。

PUNCH CLOCKS

[  {      "id": 932015,      "date": "2022-05-19T14:35:30.000+01:00",      "notification": "punchClock_deleted",      "worker": {          "number": 0      },      "entry": 1  }]

注意:只有在删除打卡机条目后,notification 字段才会出现。

STOCK

[    {        "product-code": "P1",        "stock": 2395.0,        "lot": [            {                "code": "Lot 0086",                "stock": 500.0            }        ]    }]

供应商

Prodsmart API 的供应商资源。

SUPPLIER

单个供应商对象。

供应商资源具有以下属性:

  • id(已提供)

  • code(字符串,必需,唯一)- 供应商代码

  • name(字符串,必需)- 供应商名称

  • number(字符串,可选)- 供应商增值税号

  • expiration-date(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 供应商的到期日期

  • addresses(数组,可选)

  • code(字符串,必需,唯一)- 地址代码

  • name(字符串,可选)- 地址名称

  • address(字符串,必需)- 地址行

  • city(字符串,可选)- 地址所在的城市

  • post-code(字符串,可选)- 地址的邮政编码

  • state(字符串,可选)- 地址所在的省/自治区/直辖市/地区

  • country(字符串,必需)- 地址所在的国家/地区代码

  • default(布尔值,可选,默认为 false)- 如果为 true,则为供应商默认地址

  • contacts(数组,可选)

  • phone-number(字符串,如果没有 email,则为必需参数)- 联系人的电话号码

  • email(字符串,如果没有 phone-number,则为必需参数)- 联系人的电子邮件

  • name(字符串,可选)- 联系人的姓名

  • default(布尔值,可选,默认为 false)- 如果为 true,则为供应商默认联系人

默认地址/联系人规则:

  • 只能有一个默认联系人,也只能有一个默认地址

  • 如果供应商有多个地址,其中必须有一个地址是默认地址

  • 如果供应商有多个联系人,其中必须有一个联系人是默认联系人

  • 创建/更新供应商时,如果没有给定默认联系人/地址,则第一个联系人/地址将成为默认联系人/地址

创建供应商

POST /api/suppliers{?access_token}

状态:可用

若要创建供应商,请为新供应商提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

POST /api/suppliers?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{ "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "2020-01-01T00:00:00Z", "contacts": [ { "email": "supplier@supplier.com", "phone-number": "12345678", "name": "Contact1", "default": true }, { "email": "supplier2@supplier2.com", "phone-number": "123456789", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "city": "Lisbon", "address": "Address 1 Street", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "city": "San Francisco", "address": "Address 1 Street", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 201

主体

{ "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出供应商

GET /api/suppliers{?access_token}

列出供应商。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个供应商。

示例 URI

GET /api/suppliers?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

id

数字(可选)

按 ID 过滤的供应商列表

code

字符串(可选)

按代码过滤的供应商列表

请求

标头

Content-Type: application/json

响应 200

主体

[ { "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }, { "id": 987356124, "code": "Supplier2", "name": "Supplier2", "number": "213457", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier3@supplier3.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier4@supplier4.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address3", "name": "Address3", "address": "Address 3 Street", "city": "Paris", "post-code": "111-111", "state": "Paris", "country": "FR", "default": true }, { "code": "Address4", "name": "Address4", "address": "Address 4 Street", "city": "Madrid", "post-code": "111-111", "state": "Madrid", "country": "ES", "default": false } ] } ]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

检索供应商

GET /api/suppliers/{id}{?access_token}

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/suppliers/id?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

id

数字(必需)

供应商 ID

请求

标头

Content-Type: application/json

响应 201

主体

{ "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

更新供应商

PUT /api/suppliers/{id}{?access_token}

若要更新供应商,请为新供应商提供属性的 JSON 哈希值。

联系人

  • 给定的供应商联系人将替换当前联系人。

  • 如果给定的联系人与现有联系人的姓名相同,则具有该姓名的联系人的值将由给定的值替换。

  • 如果未给定联系人,将移除现有联系人。

地址

  • 给定的地址将替换当前地址。

  • 如果给定的地址与现有地址的代码相同,则具有该代码的地址的值将由给定的值替换。

  • 如果未给定地址,将移除现有地址。

  • 如果地址具有关联的实体,请求将失败,因为无法移除该地址。

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

PUT /api/suppliers/id?access_token=

URI 参数

id

数字(必需)

客户 ID

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{ "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "2020-01-01T00:00:00Z", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 201

主体

{ "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

移除供应商

DELETE /api/suppliers/{id}{?access_token}

示例 URI

DELETE /api/suppliers/id?access_token=

URI 参数

id

数字(必需)

供应商 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

主体

Supplier was deleted

响应 412

主体

It's not possible to delete this supplier. It has dependent entities.

客户

Prodsmart API 的客户资源。

CLIENT

单个客户对象。

客户资源具有以下属性:

  • id(已提供)

  • code(字符串,必需,唯一)- 客户代码

  • name(字符串,必需)- 客户名称

  • number(字符串,可选)- 客户编号

  • phone-number(字符串,可选)- 客户的电话号码

  • email(字符串,可选)- 客户的电子邮件

  • addresses(数组,可选)

  • code(字符串,必需,唯一)- 地址代码

  • name(字符串,可选)- 地址名称

  • address(字符串,必需)- 地址行

  • city(字符串,可选)- 地址所在的城市

  • post-code(字符串,可选)- 地址的邮政编码

  • state(字符串,可选)- 地址所在的省/自治区/直辖市/地区

  • country(字符串,必需)- 地址所在的国家/地区代码

  • default(布尔值,可选,默认为 false)- 如果为 true,则为客户默认地址

  • contacts(数组,可选)

  • phone-number(字符串,如果没有 email,则为必需参数)- 联系人的电话号码

  • email(字符串,如果没有 phone-number,则为必需参数)- 联系人的电子邮件

  • name(字符串,可选)- 联系人的姓名

  • default(布尔值,可选,默认为 false)- 如果为 true,则为客户默认联系人

默认地址/联系人规则:

  • 只能有一个默认联系人,也只能有一个默认地址

  • 如果客户有多个地址,其中必须有一个地址是默认地址

  • 如果客户有多个联系人,其中必须有一个联系人是默认联系人

  • 创建/更新客户时,如果没有给定默认联系人/地址,则第一个联系人/地址将成为默认联系人/地址

创建客户

POST /api/clients{?access_token}

若要创建客户,请为新客户提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个客户。将来,如果请求是数组而不是一个资源,将会保存数组中的所有条目。

示例 URI

POST /api/clients?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{ "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "2020-01-01T00:00:00Z", "contacts": [ { "email": "supplier@supplier.com", "phone-number": "12345678", "name": "Contact1", "default": true }, { "email": "supplier2@supplier2.com", "phone-number": "123456789", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "city": "Lisbon", "address": "Address 1 Street", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "city": "San Francisco", "address": "Address 1 Street", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 201

主体

{ "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出客户

GET /api/clients{?access_token}

列出客户。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个客户。

示例 URI

GET /api/clients?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

id

数字(可选)

按 ID 过滤的客户列表

code

字符串(可选)

按代码过滤的客户列表

请求

标头

Content-Type: application/json

响应 200

主体

[ { "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }, { "id": 987356124, "code": "Supplier2", "name": "Supplier2", "number": "213457", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier3@supplier3.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier4@supplier4.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address3", "name": "Address3", "address": "Address 3 Street", "city": "Paris", "post-code": "111-111", "state": "Paris", "country": "FR", "default": true }, { "code": "Address4", "name": "Address4", "address": "Address 4 Street", "city": "Madrid", "post-code": "111-111", "state": "Madrid", "country": "ES", "default": false } ] } ]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

检索客户

GET /api/clients/{id}{?access_token}

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/clients/id?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

id

数字(必需)

客户 ID

请求

标头

Content-Type: application/json

响应 201

主体

{ "id": 987356123, "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

更新客户

PUT /api/clients/{id}{?access_token}

若要更新客户,请为新客户提供属性的 JSON 哈希值。

联系人

  • 给定的供应商联系人将替换当前联系人。

  • 如果给定的联系人与现有联系人的姓名相同,则具有该姓名的联系人的值将由给定的值替换。

  • 如果未给定联系人,将移除现有联系人。

地址

  • 给定的地址将替换当前地址。

  • 如果给定的地址与现有地址的代码相同,则具有该代码的地址的值将由给定的值替换。

  • 如果未给定地址,将移除现有地址。

  • 如果地址具有关联的实体,请求将失败,因为无法移除该地址。

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

PUT /api/clients/id?access_token=

URI 参数

id

数字(必需)

客户 ID

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "Supplier",  "name": "Supplier",  "number": "213456",  "expiration-date": "2020-01-01T00:00:00Z",   "contacts": [    {      "phone-number": "12345678",      "email": "supplier@supplier.com",      "name": "Contact1",      "default": true    },    {      "phone-number": "123456789",      "email": "supplier2@supplier2.com",      "name": "Contact2",      "default": false    }  ],  "addresses":[    {      "code": "Address1",      "name": "Address1",      "address": "Address 1 Street",      "city": "Lisbon",      "post-code": "111-111",      "state": "Lisbon",      "country": "PT",      "default": true    },    {      "code": "Address2",      "name": "Address2",       "address": "Address 1 Street",      "city": "San Francisco",      "post-code": "111-111",      "state": "California",      "country": "US",      "default": false    }  ]}

响应 201

主体

{ "code": "Supplier", "name": "Supplier", "number": "213456", "expiration-date": "01/01/2020", "contacts": [ { "phone-number": "12345678", "email": "supplier@supplier.com", "name": "Contact1", "default": true }, { "phone-number": "123456789", "email": "supplier2@supplier2.com", "name": "Contact2", "default": false } ], "addresses": [ { "code": "Address1", "name": "Address1", "address": "Address 1 Street", "city": "Lisbon", "post-code": "111-111", "state": "Lisbon", "country": "PT", "default": true }, { "code": "Address2", "name": "Address2", "address": "Address 1 Street", "city": "San Francisco", "post-code": "111-111", "state": "California", "country": "US", "default": false } ] }

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

移除客户

DELETE /api/clients/{id}{?access_token}

示例 URI

DELETE /api/clients/id?access_token=

URI 参数

id

数字(必需)

客户 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

主体

Client was deleted

响应 412

主体

It's not possible to delete this client. It has dependent entities.

销售订单

Prodsmart API 的客户订单资源。

SALES ORDER

单个销售订单对象。销售订单资源是 Prodsmart API 中最重要的资源之一。

销售订单资源具有以下属性:

  • id(已提供)

  • code(字符串,必需)- 销售订单代码

  • client(字符串,可选)- 客户代码

  • observations(字符串,可选)- 销售订单观察结果

  • products(数组,必需,非空)

    • code(字符串,必需,唯一)- 产品代码

    • quantity(双精度,必需,>0)- 订购的数量

    • due-date(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 发货的截止日期

    • requested-date(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 请求发货的日期

    • location(字符串,可选)- 位置(如果使用多场地功能)

    • price(双精度,可选)- 产品价格

  • parameters(字符串,可选)- 包含特定于销售订单的属性

创建销售订单

POST /api/client-order/{?access_token}

若要创建销售订单,请为新销售订单提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个销售订单。将来,如果请求是数组而不是一个资源,将会保存数组中的所有条目。

示例 URI

POST /api/client-order/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "observations": "Ready next week",  "billing-address": "San Francisco",  "delivery-address": "Delivery address code",  "location": "location code",  "products": [    {      "code": "V23076",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3,      "delivery-address":"San Francisco"    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price":502,      "delivery-address":"Los Angeles"    }  ],  "parameters": [    {      "name": "Sales Order Type",      "value": "Regular"    }  ]}

响应 201

主体

{  "id": 987356123,  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "billing-address":"San Francisco",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3,      "delivery-address":"San Francisco"    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price":502,      "delivery-address":"Los Angeles"    }  ],  "parameters": [    {      "name": "Sales Order Type",      "value": "Regular"    }  ]}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出销售订单

GET /api/client-order/{?access_token}

列出销售订单。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个销售订单。

示例 URI

GET /api/client-order/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

due-date-before

日期(可选)

列出截止日期在此日期之前的销售订单

due-date-after

日期(可选)

列出截止日期在此日期之后的销售订单

client

字符串(可选)

机器代码

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "id": 987356123,    "code": "CO123 - Week 47",    "creation-date": "2022-04-19T08:30:01Z",    "client": "Client X",    "observations": "Ready next week",    "products": [      {        "code": "V23076",        "name": "Vessel",        "quantity": 100,        "due-date": "2019-08-16T17:15:15Z",        "requested-date": "2019-01-16T15:19:54Z",        "price": 200.3      },      {        "code": "V23077",        "quantity": 99,        "due-date": "2016-08-16T17:15:15Z",        "requested-date": "2019-01-16T15:19:54Z"      }    ],    "parameters": [      {        "name": "Sales Order Type",        "value": "Regular"      }    ]  },  {    "id": 987356124,    "code": "CO123 - Week 48",    "client": "Client X",    "observations": "",    "products": [      {        "code": "V23076",        "name": "Vessel",        "quantity": 70,        "due-date": "2019-08-23T18:00:00Z",        "requested-date": "2019-01-16T15:19:54Z",        "price": 140      },      {        "code": "V23077",        "quantity": 69,        "due-date": "2016-08-23T18:00:00Z",        "requested-date": "2019-01-16T15:19:54Z"      }    ],    "parameters": [      {        "name": "Sales Order Type",        "value": "Priority"      }    ]  }]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

检索销售订单

GET /api/client-order/{id}{?access_token}

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/client-order/id?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

id

数字(必需)

销售订单 ID

请求

标头

Content-Type: application/json

响应 201

主体

{  "id": 987356123,  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "name": "Vessel",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ],  "parameters": [    {      "name": "Sales Order Type",      "value": "Priority"    }  ]}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

更新销售订单

PUT /api/client-order/{?access_token}

若要更新销售订单,请为新销售订单提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

PUT /api/client-order/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "observations": "Ready next week",  "billing-address": "San Francisco",  "location": "location code",  "products": [    {      "code": "V23076",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3,      "billing-address": "San Francisco"    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "billing-address": "Los Angeles"    }  ]}

响应 201

主体

{  "id": 987356123,  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "billing-address": "San Francisco",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "name": "Vessel",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3,      "billing-address": "San Francisco"    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "billing-address": "Los Angeles"    }  ]}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

移除销售订单

DELETE /api/client-order/{id}{?access_token}

示例 URI

DELETE /api/client-order/id?access_token=

URI 参数

id

数字(必需)

销售订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

主体

Client order was deleted

响应 409

主体

Client order already has production orders created or other entities associated, cannot be removed.

采购订单

Prodsmart API 的采购订单资源。

PURCHASE ORDER

单个采购订单对象。采购订单资源是 Prodsmart API 中最重要的资源之一。

采购订单资源具有以下属性:

  • id(已提供)

  • code(字符串,必需)- 采购订单代码

  • supplier(字符串,可选)- 供应商代码

  • billing-address(字符串,可选)- 帐单地址

  • observations(字符串,可选)- 采购订单观察结果

  • products(数组,必需,非空)

    • code(字符串,必需,唯一)- 产品代码

    • quantity(双精度,必需,>0)- 请求的数量

    • due-date(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 收货的截止日期

    • requested-date(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 请求收货的日期

    • cost(双精度,可选)- 产品成本

    • uom(字符串,可选)- 产品计量单位

  • delivery-address(字符串,可选)- 收货地址

  • parameters(字符串,可选)- 采购订单参数

  • approval-status(字符串,可选)- 草稿、审核中、已批准、已确认、已拒绝

创建采购订单

POST /api/purchase-orders/{?access_token}

若要创建采购订单,请为新采购订单提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个采购订单。将来,如果请求是数组而不是一个资源,将会保存数组中的所有条目。

示例 URI

POST /api/purchase-orders/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "PO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "supplier": "Supplier X",  "billing-address": "Lisbon",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "uom": "Box",      "cost": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2023-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ],  "approval-status": "draft",  "active": true}

响应 201

标头

Content-Type: application/json

主体

{  "code": "PO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "supplier": "Supplier X",  "billing-address": "Lisbon",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "uom": "Box",      "cost": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2023-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ],  "approval-status": "draft",  "active": true}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

检索采购订单

GET /api/purchase-orders/{id}{?access_token}

此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/purchase-orders/id?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

id

数字(必需)

采购订单 ID

请求

标头

Content-Type: application/json

响应 201

主体

{  "id": 987356123,  "code": "PO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "supplier": "Supplier X",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "name": "Vessel",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "cost": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2023-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ]}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

更新采购订单

PUT/api/purchase-orders/{id}{?access_token}

若要更新采购订单,请为新采购订单提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

PUT /api/purchase-orders/id?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

id

数字(必需)

采购订单 ID

请求

标头

Content-Type: application/json

主体

{  "id": 987356123,  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "name": "Vessel",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ]}

响应 201

主体

{  "id": 987356123,  "code": "CO123 - Week 47",  "creation-date": "2022-04-19T08:30:01Z",  "client": "Client X",  "observations": "Ready next week",  "products": [    {      "code": "V23076",      "name": "Vessel",      "quantity": 100,      "due-date": "2019-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z",      "price": 200.3    },    {      "code": "V23077",      "quantity": 99,      "due-date": "2016-08-16T17:15:15Z",      "requested-date": "2019-01-16T15:19:54Z"    }  ]}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

移除采购订单

DELETE /api/purchase-orders/{id}{?access_token}

示例 URI

DELETE /api/purchase-orders/id?access_token=

URI 参数

id

数字(必需)

采购订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

主体

Purchase order was deleted

响应 409

主体

Purchase order already has production orders created or other entities associated, cannot be removed.

列出采购订单

GET /api/purchase-orders{?access_token}

列出采购订单。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个销售订单。

示例 URI

GET /api/purchase-orders?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

id

数字(可选)

列出按采购订单 ID 过滤的采购订单

code

字符串(可选)

列出按采购订单代码过滤的采购订单

due-date-before

日期(可选)

列出截止日期在此日期之前的采购订单

due-date-after

日期(可选)

列出截止日期在此日期之后的采购订单

supplier

字符串(可选)

列出按供应商代码过滤的采购订单

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "id": 987356123,    "code": "PO123 - Week 47",    "creation-date": "2023-04-19T08:30:01Z",    "supplier": "Supplier X",    "observations": "Ready next week",    "products": [      {        "code": "V23076",        "name": "Vessel",        "quantity": 100,        "due-date": "2023-08-16T17:15:15Z",        "requested-date": "2023-01-16T15:19:54Z",        "cost": 200.3      },      {        "code": "V23077",        "quantity": 99,        "due-date": "2023-08-16T17:15:15Z",        "requested-date": "2023-01-16T15:19:54Z"      }    ]  },  {    "id": 987356124,    "code": "PO123 - Week 48",    "supplier": "Supplier X",    "observations": "",    "products": [      {        "code": "V23076",        "name": "Vessel",        "quantity": 70,        "due-date": "2023-08-23T18:00:00Z",        "requested-date": "2023-01-16T15:19:54Z",        "cost": 140      },      {        "code": "V23077",        "quantity": 69,        "due-date": "2023-08-23T18:00:00Z",        "requested-date": "2023-01-16T15:19:54Z"      }    ]  }]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

生产订单

Prodsmart API 的生产订单资源。

PRODUCTION ORDER

单个生产订单对象。生产订单资源是 Prodsmart API 中最重要的资源之一。它表示管理订单,要求在规定的时间段内由规定的工人生产预定数量的产品。

生产订单资源具有以下属性:

  • id(已提供)

  • code(字符串,必需)- 生产订单代码

  • start-date(日期,必需,格式为 YYYY-MM-DDTHH:MM:SSZ)- 此生产订单的预定开始日期

  • due-date(日期,必需,格式为 YYYY-MM-DDTHH:MM:SSZ)- 此生产订单的截止日期

  • products(数组,必需,非空)- 订购的产品和数量

  • product(字符串,必需,唯一)- 产品代码

  • quantity-ordered(整数,必需,>0)- 订购的数量

  • observations(可选)- 有关此产品的备注

  • quantity-produced(整数,已提供,>0)- 生产的数量

  • description(可选)- 此生产订单的描述

  • shipping(可选)- 此订单的发货代码

  • workers-assigned(数组,可选)

  • number - 工人编号

  • machines(数组,可选)

  • code - 机器代码

  • serial-number(可选)

  • description(可选)

  • notes(可选)

  • status(已提供)- scheduled(在 start_date 之前完成度 = 0)、onschedule(在 end_date 之前完成度 < 100%)、delayed(在 end_date 之后完成度 < 100%)、completed(完成度 >= 100%)

  • running-status(已提供)- notstarted(无生产)、started(有生产)、closed(已手动关闭或因完成而关闭)、archived(已手动存档)

状态 ID 由 Prodsmart API 在创建时分配。

检索生产订单

GET /api/production-orders/{id}{?access_token}

若要检索生产订单,只需使用生产订单的 ID 执行 GET 请求。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/production-orders/id?access_token=

URI 参数

id

数字(必需)

生产订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

workers

布尔值(可选)

显示响应的工人列表

请求

标头

Content-Type: application/json

响应 200

主体

{  "products": [    {      "product": "V23076",      "quantity-ordered": 3500,      "observations": "",      "quantity-produced": 700    }  ],  "code": "V23076 - Week 33/34",  "shipping": {    "code": "shipping 45"  },  "start-date": "2023-04-20T09:15:15Z",  "due-date": "2023-05-16T17:15:15Z",  "description": "Woodworks Ltd.",  "ended": false,  "custom-fields": [    {      "Order Type": "No changeover"    }  ],  "machines": [    {      "code": "A32"    }  ],  "pieces-by-box": 20,  "is-active": true,  "status": "onschedule",  "running-status": "started",  "notes": "",  "location":    {      "id": "location id",      "code": "location code",      "name": "location name"    },  "material-staging-complete": true,  "id": 3990}

更新/替换生产订单

PUT /api/production-orders/{id}{?access_token}

若要更新生产订单,只需使用生产订单的 ID 执行 PUT 请求。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

PUT /api/production-orders/id?access_token=

URI 参数

id

数字(必需)

生产订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

workers

布尔值(可选)

显示响应的工人列表

请求

标头

Content-Type: application/json

主体

{  "products": [    {      "product": "V23076",      "quantity-ordered": 4000,      "observations": "",      "quantity-produced": 700    }  ],  "code": "V23076 - Week 33/34",  "shipping": {    "code": "shipping 45"  },  "start-date": "2023-04-20T09:15:15Z",  "due-date": "2023-05-16T17:15:15Z",  "description": "Woodworks Ltd.",  "ended": false,  "custom-fields": [    {      "Order Type": "No changeover"    }  ],  "machines": [    {      "code": "A32"    }  ],  "pieces-by-box": 20,  "is-active": true,  "status": "onschedule",  "running-status": "started",  "notes": "",  "location": "location code",  "material-staging-complete": true,  "id": 3990}

响应 200

主体

{  "products": [    {      "product": "V23076",      "quantity-ordered": 4000,      "observations": "",      "quantity-produced": 700    }  ],  "code": "V23076 - Week 33/34",  "shipping": {    "code": "shipping 45"  },  "start-date": "2023-04-20T09:15:15Z",  "due-date": "2023-05-16T17:15:15Z",  "description": "Woodworks Ltd.",  "ended": false,  "custom-fields": [    {      "Order Type": "No changeover"    }  ],  "machines": [    {      "code": "A32"    }  ],  "pieces-by-box": 20,  "is-active": true,  "status": "onschedule",  "running-status": "started",  "notes": "",  "location":    {      "id": "location id",      "code": "location code",      "name": "location name"    },  "material-staging-complete": true,  "id": 3990}

移除生产订单

DELETE /api/production-orders/{id}{?access_token}

示例 URI

DELETE /api/production-orders/id?access_token=

URI 参数

id

数字(必需)

生产订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

主体

Production order was deleted

创建生产订单

POST /api/production-orders/{?access_token}

若要创建生产订单,请为新生产订单提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个生产订单。将来,如果请求是数组而不是一个资源,将会保存数组中的所有条目。

示例 URI

POST /api/production-orders/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

workers

布尔值(可选)

显示响应的工人列表

请求

标头

Content-Type: application/json

主体

{  "products": [    {      "product": "productExample",      "quantity-ordered": 4500,      "observations": ""    }  ],  "code": "exampleCode",  "shipping": "shippingExample",  "serial-number": "",  "description": "",  "start-date": "2023-07-20T09:15:15Z",  "due-date": "2023-08-16T17:15:15Z",  "parameters": [    {      "name": "Custom Field Name",      "value": "123"    },    {      "name": "Custom Field Name 2",      "value": "456"    }  ],  "workers-assigned": [    {      "number": 1    },    {      "number": 3    }  ],  "worker-groups": [    {      "name": "All"    }  ],  "ended": false,  "machines": [    {      "code": "exampleMachine"    },    {      "code": "F1"    }  ],  "pieces-by-box": 20,  "notes": "",  "location": "location code",  "active": true}

响应 201

主体

{    "products": [      {        "product": "productExample",        "quantity-ordered": 4500,        "observations": "",        "quantity-produced": 0      }    ],    "code": "exampleCode",    "shipping": "shippingExample",    "serial-number": "",    "description": "",    "start-date": "2023-07-20T09:15:15Z",    "due-date": "2023-08-16T17:15:15Z",    "workers-assigned": [      { "number": 1 },      { "number": 2 }      { "number": 3 }      { "number": 4 }    ],    "ended": false,    "machines": [      {"code": "exampleMachine"},      {"code": "F1"}    ],    "pieces-by-box": 20,    "status": "scheduled",    "running-status": "notstarted",    "notes": "",    "location":      {        "id": "location id",        "code": "location code",        "name": "location name"      },    "active": true,    "id": 11110}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出生产订单

GET /api/production-orders/{?access_token}

列出生产订单。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个 PO。

示例 URI

GET /api/production-orders/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

start-date-before

日期(可选)

列出开始日期在此日期之前的生产订单

start-date-after

日期(可选)

列出开始日期在此日期之后的生产订单

due-date-before

日期(可选)

列出截止日期在此日期之前的生产订单

due-date-after

日期(可选)

列出截止日期在此日期之后的生产订单

running-status

字符串(可选)

notstarted、started、closed、archived

active

布尔值(可选)

仅列出活动 (true) 或非活动 (false) 生产订单

product

字符串(可选)

产品代码

机床

字符串(可选)

机器代码

workers

布尔值(可选)

显示响应的工人列表

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "products": [      {        "product": "exampleProduct",        "quantity-ordered": 4500,        "observations": "",        "quantity-produced": 0      }    ],    "code": "exampleCode",    "shipping": "Shipping 45",    "serial-number": "",    "description": "",    "start-date": "2023-07-20T09:15:15Z",    "due-date": "2023-08-16T17:15:15Z",    "workers-assigned": [      {        "number": 10      },      {        "number": 1      }    ],    "ended": false,    "machines": [      {        "code": "exampleMachine"      },      {        "code": "F1"      }    ],    "pieces-by-box": 20,    "status": "scheduled",    "running-status": "notstarted",    "notes": "",    "location":      {        "id": "location id",        "code": "location code",        "name": "location name"      },    "active": true,    "id": 8763990  }]

通知生产订单问题

POST /api/production-orders/{id}/notify{?access_token}

此服务用于在 feed 上发布 short-message,并在生产订单上添加 message。

  • short-message(字符串,必需)- 在 feed 中发布的消息,最多包含 140 个字符

  • message(字符串,可选)- 添加到 PO 中备注部分的消息

示例 URI

POST /api/production-orders/id/notify?access_token=

URI 参数

id

数字(必需)

生产订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "short-message": "example",  "message": "complete message "}

响应 200

激活生产订单

POST /api/production-orders/{id}/activate{?access_token}

此服务用于激活生产订单。

示例 URI

POST /api/production-orders/id/activate?access_token=

URI 参数

id

数字(必需)

生产订单 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{}

响应 200

响应 204

主体

Production Order was already active

响应 405

主体

Production Order was closed or archived and cannot be activated

产品

Prodsmart API 的产品资源。

PRODUCT

单个产品对象。产品资源是 Prodsmart API 中最重要的资源之一。它表示工厂中的产品,并包含生产所需的操作。此方法将创建新产品及其操作。也可以使用

产品资源具有以下属性:

  • code(字符串,必需)- 产品代码

  • name(字符串,必需)- 产品名称

  • section(字符串,可选)

  • families(数组,可选)

  • operations(数组,可选)- 生产产品所执行的操作

    • code(字符串,必需)- 操作代码

    • name(字符串,必需)- 操作名称

    • waste(数组,可选)

    • task-durations(数组,可选,max:1)

      • duration(时间,可选,例如格式为“10H59m59s”)- 理论上,执行此操作所需的平均时间

      • duration-customer(时间,可选,例如格式为“10H59m59s”)- 在预算中设置的时间

      • ratio-quantity(双精度,可选,默认值为 1.0)- 在此操作的每个实例中生产的量

    • times-per-product(整数,可选,默认值为 1)- 为了完成一个产品单位而必须执行此操作的次数

    • custom-fields(数组,可选,必须存在于系统中)- 要向操作添加的自定义字段

      • name(字符串,必需)- 自定义字段名称,已在系统中创建

    • machines(数组,可选,必须存在于系统中)- 可用于执行操作的机器

      • code(字符串,必需)- 机器代码,已在系统中创建

    • disabled(布尔值,可选)- 禁用操作

    • optional(布尔值,可选)- 将操作设置为可选

    • recovery(布尔值,可选)- 将操作设置为恢复

    • no-time(布尔值,可选)- 不登记生产时间

    • no-quantity(布尔值,可选)- 不登记生产数量

    • as-team(布尔值,可选)- 要以团队形式执行的操作

    • max-waste-threshold(双精度,可选)- 允许的最大废料率

请求中不存在的字段将设置为默认值。对现有产品/操作使用此方法时,不存在的字段将被视为已删除。

检索产品

GET /api/products/{code}{?access_token}

若要检索产品,只需使用产品的代码执行 GET 请求。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/products/code?access_token=

URI 参数

code

字符串(必需)

产品代码。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 200

主体

{  "code": "P11",  "name": "Product 11",  "section": null,  "families": null,  "color": "#8b0000",  "observations": "observations",  "operations": [    {      "code": "op1",      "name": "op1",      "waste": null,      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "custom-fields": null,      "machines": null,      "disabled": false,      "optional": false,      "recovery": null,      "no-time": false,      "no-quantity": false,      "as-team": false,      "max-waste-threshold": null,      "section": {        "name": "specialsection"      },      "id": 100    }  ],  "custom-fields": null,  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    },    {      "name": "parameter3",      "value": 1    }  ],  "label": {    "code": "labelCode"  },  "serializable": true,  "id": 24}

响应 404

主体

If product with the provided code doesn't exist.

创建产品

POST /api/products{?access_token}

若要创建产品,请为新产品及其操作提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。可以同时创建多个操作。

示例 URI

POST /api/products?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "P11",  "name": "Product 11",  "families": [    {      "code": "FG"    }  ],  "color": "#8b0000",  "observations": "observations",  "operations": [    {      "code": "op1",      "name": "op1",      "waste": [        {          "code": "BROKEN"        }      ],      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "times-per-product": 2.0,      "checklists": [        {          "code": "CheckIn"        }      ],      "machines":  [        {          "code": "OVEN02"        }      ],      "disabled": false,      "optional": false,      "recovery": false,      "no-time": false,      "no-quantity": false,      "as-team": false,      "multi-po": false,      "print-production-barcode": false,      "prepare-batch-order": false,      "section": {        "name": "CUT"      }    }  ],  "custom-fields": null,  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    }  ],  "serializable": true}

响应 201

主体

{  "code": "P11",  "name": "Product 11",  "families": [    {      "code": "FG"    }  ],  "color": "#8b0000",  "observations": "observations",  "operations": [    {      "code": "op1",      "name": "op1",      "waste": [        {          "code": "BROKEN"        }      ],      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "times-per-product": 2.0,      "checklists": [        {          "code": "CheckIn"        }      ],      "custom-fields": null,      "machines":  [        {          "code": "OVEN02"        }      ],      "disabled": false,      "optional": false,      "recovery": null,      "no-time": false,      "no-quantity": false,      "as-team": false,      "section": {        "name": "CUT"      }      "id":560    }  ],  "custom-fields": null,  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    }  ],  "serializable": true  "id":120}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

更新产品

PUT /api/products/{code}{?access_token}

若要更新产品,请为现有产品及其操作提供代码和属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个产品,但可以同时创建多个操作。

示例 URI

PUT /api/products/code?access_token=

URI 参数

code

字符串(必需)

产品代码。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "code": "P11",  "name": "Product 11",  "families": [    {      "code": "FG"    }  ],  "color": "#8b0000",  "observations": "observations",  "operations": [    {      "code": "op1",      "name": "op1",      "waste": [        {          "code": "BROKEN"        }      ],      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "times-per-product": 2.0,      "checklists": [        {          "code": "CheckIn"        }      ],      "custom-fields": null,      "machines":  [        {          "code": "OVEN02"        }      ],      "disabled": false,      "optional": false,      "recovery": null,      "no-time": false,      "no-quantity": false,      "as-team": false,      "section": {        "name": "CUT"      }    }  ],  "custom-fields": null,  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    }  ],  "serializable": true}

响应 201

主体

{  "code": "P11",  "name": "Product 11",  "families": [    {      "code": "FG"    }  ],  "color": "#8b0000",  "observations": "observations",  "operations": [    {      "code": "op1",      "name": "op1",      "waste": [        {          "code": "BROKEN"        }      ],      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "times-per-product": 2.0,      "checklists": [        {          "code": "CheckIn"        }      ],      "custom-fields": null,      "machines":  [        {          "code": "OVEN02"        }      ],      "disabled": false,      "optional": false,      "recovery": null,      "no-time": false,      "no-quantity": false,      "as-team": false,      "section": {        "name": "CUT"      }      "id":560    }  ],  "custom-fields": null,  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    }  ],  "serializable": true  "id":120}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

删除产品

DELETE /api/products/{code}{?access_token}

若要删除产品,请提供产品代码。

示例 URI

DELETE /api/products/code?access_token=

URI 参数

code

字符串(必需)

产品代码。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

Content-Type: application/json

响应 204

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出产品

GET /api/products{?access_token}

列出产品及其操作。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/products?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

product-family-code

字符串(可选)

列出属于提供的产品系列的产品

modification-date

日期(可选)

列出在提供的日期之后通过后台修改的产品

请求

标头

Content-Type: application/json

响应 200

主体

{  "code": "P11",  "name": "Product 11",  "observations": "",  "section": null,  "unit-cost": null,  "unit-price": 4.32000,  "families": [    {      "code": "FG",      "name": "Finished Goods"    }  ],  "operations": [    {      "code": "op1",      "name": "op1",      "waste": null,      "task-durations": [        {          "validSince": "01/01/2022 - 13:00",          "validUntil": "01/01/2100 - 13:00",          "duration": "00H01m00s",          "duration-customer": "00H01m00s",          "ratio-quantity": 1        }      ],      "custom-fields": null,      "parameters": [        {          "name": "parameter1",          "value": "value1"        }      ],      "machines": null,      "disabled": false,      "optional": false,      "recovery": null,      "no-time": false,      "no-quantity": false,      "as-team": false,      "max-waste-threshold": null,      "section": {        "name": "specialsection"      },      "id": 123    }  ],  "components": [    {      "code": "SUGAR",      "name": "Sugar",      "quantity": 0.0015,      "operation": "MIXING"    },    {      "code": "VANILLA",      "name": "Vanilla",      "quantity": 0.0008,      "operation": "MIXING"    }  ],  "serializable": false,  "custom-fields": null}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

PRODUCT BOM

产品的物料清单 (BoM) 资源规定了制造特定产品所使用的材料。BoM 具有以下属性:

  • product-code - 主产品

  • bom(数组,必需)

    • product-code(字符串,必需)- 组件/消耗产品代码

    • quantity(双精度,必需)- 数量

    • operation-code(字符串,可选)- 消耗在 product-code 中定义的材料的操作代码。如果为空,则消耗将发生在此产品的制造流程的第一个操作中。

更新产品 BoM

POST /api/bom{?access_token}

若要更新产品的物料清单,请为新产品及其操作提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

POST /api/bom?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "product-code": "bicycle",  "bom": [    {      "product-code": "wheel",      "quantity": 2,      "operation-code": "assemble"    },    {      "product-code": "seat",      "quantity": 1,      "operation-code": "assemble"    }  ]}

响应 201

{  "product-code": "bicycle",  "bom": [    {      "product-code": "wheel",      "quantity": 2,      "operation-code": "assemble"    },    {      "product-code": "seat",      "quantity": 1,      "operation-code": "assemble"    }  ]}

响应 404

主体

Main product not found

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

PRODUCT STOCK

库存资源规定了特定产品的可用库存。

  • product-code(字符串,必需)

  • stock(双精度,必需)

  • date(日期,可选)- 库存盘点的日期

更新产品库存

POST /api/stock{?access_token}

若要更新产品的库存,请为其当前库存提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

POST /api/stock?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "product-code": "bicycle",  "stock": 200.5,  "date": "2023-08-16T17:15:15Z"}

响应 201

主体

Request successful

响应 404

主体

Product not found

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

产品系列

Prodsmart API 的产品资源。

PRODUCT FAMILY

产品系列对象表示产品所属的一个或多个系列。

产品系列资源具有以下属性:

  • code(字符串,必需)- 产品系列代码

  • name(字符串,必需)- 产品系列名称

创建产品系列

POST /api/product-families{?access_token}

创建一个或多个产品系列。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

POST /api/product-families?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "product-families": [    {      "code": "FAM 1",      "name": "Family 1"    },    {      "code": "FAM 2",      "name": "Family 2"    }  ]}

响应 201

主体

[  {    "code": "FAM 1",    "name": "Family 1"  },  {    "code": "FAM 2",    "name": "Family 2"  }]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

删除产品系列

DELETE /api/product-family/{code}{?access_token}

若要删除产品系列,请提供产品系列代码。

示例 URI

DELETE /api/product-family/code?access_token=

URI 参数

code

字符串(必需)

产品代码。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

Content-Type: application/json

响应 204

主体

Product Family was deleted

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出产品系列

GET /api/product-families{?access_token}

列出产品系列。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/product-families?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

请求

标头

Content-Type: application/json

响应 201

主体

[  {    "code": "FAM 1",    "name": "Family 1"  },  {    "code": "FAM 2",    "name": "Family 2"  }]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

机器

Prodsmart API 的生产资源。

COUNTER

更新计数器

POST /api/machines/{machine_code}/counter{?access_token}

若要更新机器中的当前计数器,只需发送以下请求。为了简化机器连接,您可以使用 access_token 或在基本身份验证方法的身份验证标头中发送 api 凭据。Prodsmart 将自动更新工人在该机器上开始的生产。数量计数和废料数量都必须是递增的(即,始终大于之前发送的数量)。

示例 URI

POST /api/machines/machine_code/counter?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

machine_code

字符串(必需)

在 Prodsmart 平台中定义的机器代码

请求

标头

Content-Type: application/json

主体

{  "count": 500,  "waste": [    {      "code": "Waste1",      "quantity": 20    }  ],  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    },    {      "name": "parameter3",      "value": 1    }  ]}

响应 200

主体

Returns the new value for the machine's counter.

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

PARAMETERS

更新参数

POST /api/machines/{machine_code}/parameters{?access_token}

若要更新机器参数,只需发送以下请求。为了简化机器连接,您可以使用 access_token 或在基本身份验证方法的身份验证标头中发送 api 凭据。传递这些参数时,如果生产记录

示例 URI

POST /api/machines/machine_code/parameters?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

machine_code

字符串(必需)

在 Prodsmart 平台中定义的机器代码

请求

标头

Content-Type: application/json

主体

{  "parameters": [    {      "code": "temperature",      "value": 25    },    {      "code": "valid",      "value": "yes"    }  ]}

响应 200

DOWNTIME

更新停工期

POST /api/machines/{machine_code}/startstop{?access_token}

若要更新机器中的当前状态,只需发送以下请求。为了简化机器连接,您可以使用 access_token 或在基本身份验证方法的身份验证标头中发送 api 凭据。Prodsmart 将根据收到的信息自动登记停工期或使其结束。如果机器已停止,发送 0;如果机器正在运行,发送 1,并指定停工期类型。

若要更新机器状态,请指定以下属性:

  • type(字符串,必需,必须是已经分配给机器的停工期类型)- 停工期类型

  • running(数字,必需,0 或 1)- 机器已停止 (0) 或正在运行 (1)

示例 URI

POST /api/machines/machine_code/startstop?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

machine_code

字符串(必需)

在 Prodsmart 平台中定义的机器代码

请求

标头

Content-Type: application/json

主体

{  "type": "Maintenance",  "running": 0}

响应 200

生产

Prodsmart API 的生产资源。

PRODUCTION

单个生产对象。生产资源是 Prodsmart API 的中心资源。它表示一个工人在一段时间内在一个岗位上的劳动。

生产资源具有以下属性:

  • id

  • start-time(日期,必需,格式为 YYYY-MM-DDTHH:MM:SSZ)- 生产开始时间

  • end-time(日期,必需,格式为 YYYY-MM-DDTHH:MM:SSZ)- 生产结束时间

  • work-time(持续时间,给定,格式为 00H00m00s)- 生产工作时间(在排班时间/打卡机时间内,不包括停工期)

  • production-order(可选)- 完成此生产所针对的生产订单

    • code(字符串,必需)- 生产订单代码

    • id(字符串,必需)

  • operation(必需)- 在此生产中执行的任务

    • code(字符串,必需,唯一)- 任务代码

    • product(必需)- 工人在此岗位上生产的物质商品

  • quantity(整数,必需,>0)- 在此生产中生产的数量

  • worker(必需)- 执行任务的人

    • number(长型,必需,唯一)- 工人编号

  • produced-waste(数组,可选)- 操作中输出的有缺陷的材料

    • quantity(数字,必需)- 废料数量

      • waste - 有缺陷的材料类型

      • code(字符串,必需,唯一)- 废料代码

      • description(字符串,必需)- 废料描述

      • flaw(字符串,必需)- 废料类型

      • quantity(整数,必需)- 生产的废料量

状态 ID 由 Prodsmart API 在创建时分配。

更新生产

PUT /api/productions/{id}{?access_token}

若要更新生产,请为现有生产提供代码和属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一个产品,但可以同时创建多个操作。

示例 URI

PUT /api/productions/id?access_token=

URI 参数

id

数字(必需)

生产 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "shipping": {    "code": "shippingexamplecode00"  },  "production-order": {    "code": "productionorderexample00"  },  "operation": {    "product-code": "otherProductCode",    "code": "OtherOperationCode"  },  "worker": {    "number": "1000"  },  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    },    {      "name": "parameter3",      "value": 1    }  ],  "quantity": 100,  "start-time": "2023-07-20T09:15:15Z",  "end-time": "2023-07-20T09:15:16Z",  "lot-number": "other lot",  "finished": false}

响应 200

主体

{  "id": 4629374,  "production-order": {    "code": "productionorderexample00",    "id": 365315  },  "shipping": {    "code": "shippingexamplecode00",    "id": 41741  },  "operation": {    "code": "OtherOperationCode",    "product-code": "otherProductCode",    "id": 790486  },  "worker": {    "number": 1000,    "name": "Worker Name",    "id": 15890  },  "parameters": [    {      "name": "parameter1",      "value": "value1"    },    {      "name": "parameter2",      "value": "2022-12-19T00:00:00Z"    },    {      "name": "parameter3",      "value": 1    }  ],  "quantity": 100,  "lot-number": "other lot",  "start-time": "2023-07-20T09:15:15.000Z",  "end-time": "2023-07-20T09:15:16.000Z",  "finished": false}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

删除生产

DELETE /api/productions/{id}{?access_token}

若要删除生产,请提供生产 ID。

示例 URI

DELETE /api/productions/id?access_token=

URI 参数

id

数字(必需)

生产 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

Content-Type: application/json

响应 201

主体

{  "id": 4629376,  "production-order": {    "code": "productionorderexample00",    "id": 365315  },  "shipping": {    "code": "shippingexamplecode00",    "id": 41741  },  "operation": {    "code": "operationexample0001",    "product-code": "productcodeexample001",    "id": 790486  },  "worker": {    "number": 1000,    "name": "worker example",    "id": 15890  },  "parameters": [{    "name": "parameter1",    "value": "value1"  }, {    "name": "parameter2",    "value": "2022-12-19T00:00:00Z"  }, {    "name": "parameter3",    "value": 1.0  }],  "quantity": 100.0,  "lot-number": "lotX",  "start-time": "2023-07-20T09:15:15.000Z",  "end-time": "2023-07-20T09:15:16.000Z",  "finished": false}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body

列出生产

GET /api/productions{?access_token}

列出生产。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个生产记录。

示例 URI

GET /api/productions?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

production-order-id

数字(可选)

列出这个 production-order 的生产

production-order-code

字符串(可选)

列出这个(或这些)production-order 的生产

worker

数字(可选)

列出此工人(工人编号)的生产

start-time-before

日期(可选)

列出开始时间在此时间之前的生产

start-time-after

日期(可选)

列出开始时间在此时间之后的生产

end-time-before

日期(可选)

列出结束时间在此时间之前的生产

end-time-after

日期(可选)

列出结束时间在此时间之后的生产

start-time

日期(可选)

列出在此 start-time 之后运行的生产(不要与 -before -after 结合使用)

checked-out

布尔值(可选)

列出签出的生产。

worker-name

布尔值(可选)

检索工人的姓名和编号,而不是只检索工人的编号。

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "production-order": {      "code": "PO1",      "id": 36530    },    "operation": {      "code": "2",      "product": "Product 1"    },    "worker": {      "number": 2    },    "machine": {      "code": "Machine Code"    },    "produced-waste": [      {        "quantity": 21,        "waste": {          "code": "Waste code",          "description": "Description of this type of waste",          "flaw": "Flaw",          "recoverable": true,          "billable": false,          "id": 333        }      }    ],    "parameters": [      {        "parameter1": "value1"      },      {        "parameter2": 2      }    ],    "quantity": 0,    "checked-out": false,    "work-time": "00H00m00s",    "start-time": "2023-09-20T17:55:32.000+01:00",    "end-time": "2023-09-20T18:45:00.000+01:00",    "id": 575354  }]

停工期

Prodsmart API 的停工期资源。

DOWNTIMES

列出停工期

GET /api/downtimes{?access_token}

列出停工期。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/downtimes?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

start-time-before

日期(可选)

列出开始时间在此时间之前的停工期

start-time-after

日期(可选)

列出开始时间在此时间之后的停工期

end-time-before

日期(可选)

列出结束时间在此时间之前的停工期

end-time-after

日期(可选)

列出结束时间在此时间之后的停工期

machine

数字(可选)

列出此机器的停工期

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "id": 20146,    "start-time": "2017-12-21T10:30:21.000Z",    "end-time": "2017-12-21T10:32:21.000Z",    "started-by": {      "number": 2    },    "closed-by": {      "number": 2    },    "workers": [],    "machines": [      {        "code": "M2",        "name": "Machine 2"      }    ],    "product": "ProdX",    "production-order": "OP XPTO",    "checked-out": true,    "downtime-type": "Malfunction",    "time-spent": "00H02m00s"  }]

打卡机

Prodsmart API 的打卡机资源。

PUNCHCLOCK

Webhook 可用于应用程序的集成菜单中的打卡机事件。为了使用此功能,请向要侦听的通知事件添加端点 URL 回调。我们力求在系统中发生事件时尽快发送 Webhook 通知。当前,我们不支持任何重试。

列出打卡机条目

GET /api/punchclocks{?access_token}

列出打卡机条目。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/punchclocks?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

date-before

日期(可选)

列出早于此日期的打卡机条目

date-after

日期(可选)

列出晚于此日期的打卡机条目

worker

数字(可选)

列出此工人的打卡机条目

请求

标头

Content-Type: application/json

响应 200

主体

[{    "id": 372179,    "date": "2018-09-21T09:24:06.000+01:00",    "worker": {        "number": 2    },    "type": 1},{    "id": 372180,    "date": "2018-09-21T16:34:12.000+01:00",    "worker": {        "number": 2    },    "type": 0}]"type": 0 ('out') or 1 ('in')

库存移动

Prodsmart API 的库存移动资源。

INVENTORY MOVEMENT

单个库存移动对象。库存移动资源是 Prodsmart API 中最重要的资源之一。

库存移动资源具有以下属性:

  • id(已提供)

  • product(字符串,必需)- 产品代码

  • date-time(日期,可选,格式为 YYYY-MM-DDTHH:MM:SSZ)- 创建库存移动的日期

  • quantity(双精度,必需)- 库存移动数量

  • type(字符串,必需)- 库存移动类型:in、out、consumption、production

  • lot(字符串,可选)- 要使用的库存移动批次

  • total-cost(大十进制数,可选)- 库存移动数量总成本

  • warehouse-location(字符串,可选)- 仓库位置代码

  • warehouse(字符串,可选)- 仓库代码

  • location(字符串,可选)- 位置(如果使用多场地功能)

  • comment(字符串,可选)- 库存移动注释

检索库存移动

GET /api/inventory-movements/{id}{?access_token}

若要检索库存移动,只需使用库存移动的 ID 执行 GET 请求。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/inventory-movements/id?access_token=

URI 参数

id

数字(必需)

库存移动 ID。

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 200

主体

{  "product-code": "ProductCode",  "date-time": "2018-07-20T09:15:15Z",  "quantity": "10",  "type": "in",  "lot": "A",  "total-cost": "1000",  "comment": "OK",  "warehouse-location": "Zone2",  "shipping": {    "code": "shippingCode",    "clientOrder": {      "code": "clientOrderCode",      "client": "clientCode"    },    "location": {      "id": "location id",      "code": "location code",      "name": "location name"    }  },  "receiving": {    "code": "receivingCode",    "purchaseOrder": {      "code": "purchaseOrderCode",      "supplier": "supplierCode"    },    "location": {      "id": "location id",      "code": "location code",      "name": "location name"    }  }}

创建库存移动

POST /api/inventory-movements/{?access_token}

若要创建库存移动,请为新库存移动提供属性的 JSON 哈希值。此操作需要一个具有 productions_write 作用域的 access_token。目前,只能保存一次库存移动。将来,如果请求是数组而不是一个资源,将会保存数组中的所有条目。

示例 URI

POST /api/inventory-movements/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{  "product-code": "ProductCode",  "date-time": "2018-07-20T09:15:15Z",  "quantity": "10",  "type": "in",  "lot": "A",  "total-cost": "1000",  "comment": "OK",  "warehouse": "A",  "warehouse-location": "Zone2",  "location": "location code",  "shipping": "shippingCode",  "client-order": "clientOrderCode",  "receiving": "receivingCode",  "purchase-order": "purchaseOrderCode"}

响应 200

主体

{  "product-code": "ProductCode",  "date-time": "2018-07-20T09:15:15Z",  "quantity": "10",  "type": "in",  "lot": "A",  "total-cost": "1000",  "comment": "OK",  "warehouse-location": "Zone2",  "id": 12345,  "shipping": {    "code": "shippingCode",    "clientOrder": {      "code": "clientOrderCode",      "client": "clientCode"    },    "location": {      "id": "location id",      "code": "location code",      "name": "location name"    }  },  "receiving": {    "code": "receivingCode",    "purchaseOrder": {      "code": "purchaseOrderCode",      "supplier": "supplierCode"    },    "location": {      "id": "location id",      "code": "location code",      "name": "location name"    }  }}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body.

更新库存移动

PUT /api/inventory-movements/{id}{?access_token}

若要更新库存移动,请为 JSON 提供要在库存移动中更新的属性(所有属性都是可选的)。此操作需要 access_token 使用 productions_write scope.

示例 URI

PUT /api/inventory-movements/id?access_token=

URI 参数

id

numeric (必需)

库存移动 ID。

access_token

string (必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

主体

{ "product-code": "ProductCode", "date-time": "2018-07-20T09:15:15Z", "quantity": "10", "type": "in", "lot": "A", "total-cost": "1000", "comment": "OK", "warehouse": "A", "warehouse-location": "Zone2", "receiving": "receivingCode" }

删除库存移动

DELETE /api/inventory-movement/{id}{?access_token}

若要删除库存移动,请提供库存移动 ID。

示例 URI

DELETE /api/inventory-movement/id?access_token=

URI 参数

id

numeric (必需)

库存移动 ID。

access_token

string (必需)

Prodsmart API 访问令牌。

请求

标头

Content-Type: application/json

响应 204

响应 400

It's not possible to delete this inventory-movement.

列出库存移动

GET /api/inventory-movements/{?access_token}

列出库存移动。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。此服务是分页的,每页返回 25 个 IM。

示例 URI

GET /api/inventory-movements/?access_token=

URI 参数

access_token

字符串(必需)

Prodsmart API 访问令牌。

page

数字(可选)

结果页面索引,从 1 开始

product-code

字符串(可选)

产品代码

type

字符串(可选)

库存移动类型:in、out、consumption、production

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "product-code": "ProductCode",    "date-time": "2018-07-20T09:15:15Z",    "quantity": "10",    "type": "in",    "lot": "A",    "total-cost": "1000",    "comment": "OK",    "warehouse-location": "Zone2",    "id": 12345,    "shipping": {      "code": "shippingCode",      "clientOrder": {        "code": "clientOrderCode",        "client": "clientCode"      },      "location": {        "id": "location id",        "code": "location code",        "name": "location name"      }    },    "receiving": {      "code": "receivingCode",      "purchaseOrder": {        "code": "purchaseOrderCode",        "supplier": "supplierCode"      },      "location": {        "id": "location id",        "code": "location code",        "name": "location name"      }    }  }]

库存

Prodsmart API 的库存资源。

检索产品库存

GET /api/stock/{code}{?access_token}

若要检索产品库存,只需使用产品的代码执行 GET 请求。多个参数将被视为 AND 条件。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/stock/code?access_token=

URI 参数

code

字符串(必需)

产品代码。

access_token

字符串(必需)

Prodsmart API 访问令牌。

lot

字符串(可选)

检索产品批次的批次代码和库存数量

请求

标头

Content-Type: application/json

响应 200

主体

{"product-code": "Example","stock": 35,"lot": [     {      "code": "A",      "stock": 10    },    {      "code": "B",      "stock": 5    }}

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body.

报告

Prodsmart API 的报告资源。

工人劳动时间

工人劳动时间 GET/api/reports/worker-labor-time{?access_token}

若要检索报告,只需使用提取报告的时间间隔执行 GET 请求。您可以添加工人和工段参数来过滤报告。此外,您还可以指定一些标志来自定义报告内容。所有标志的默认值均为 false。此操作需要一个具有 productions_write 作用域的 access_token。

示例 URI

GET /api/reports/worker-labor-time?access_token=

URI 参数

start-time

字符串(必需)

生成晚于此日期(含)的报告

end-time

字符串(必需)

生成早于此日期(含)的报告

access_token

字符串(必需)

Prodsmart API 访问令牌

worker-number

字符串(可选)

指定工人编号以过滤报告

section

字符串(可选)

指定工段名称。此工段的所有工人都将包含在报告中

show-rework

布尔值(可选)

在报告中包含一个有关返工操作的新字段

show-weekend

布尔值(可选)

在数据中包含周末

only-punch-clock

布尔值(可选)

仅考虑具有打卡机条目的在岗时间

page

数字(可选)

结果页面索引,从 1 开始

请求

标头

Content-Type: application/json

响应 200

主体

[  {    "worker": {      "number": "0",      "name": "John"    },    "presence-time": "08H00",    "work-time": "04H00m00s",    "percentage": "50%",    "calendar-downtimes": "00H00m00s"  },  {    "worker": {      "number": "1",      "name": "Mary"    },    "presence-time": "08H00",    "work-time": "08H00m00s",    "percentage": "100%",    "calendar-downtimes": "00H00m00s"  }]

响应 400

主体

If there's a problem with the request, the problem found will be reported on the Response Body.

响应 429

主体

Another request is ongoing for this endpoint. Please wait until the current request finishes before doing another.

访问授权和控制

访问和控制 Prodsmart 身份验证令牌。

AUTHORIZATION

授权资源表示授予公司的权限。您只能访问自己的授权。使用的身份验证是基本身份验证,其中身份验证标头采用 <API_KEY:API_SECRET 的 base64 编码值> 形式。若要获取 API 密钥和私钥,请登录 Prodsmart 并编辑用户。(注意:您必须具有管理员角色才能获取。)授权资源具有以下属性:

  • token

  • scopes

其中,token 表示令牌,scopes 是针对给定授权授予的作用域的数组。目前,唯一可用的作用域是 productions_write

检索授权

GET /api/authorization

使用 GET 检索现有访问令牌。如果令牌尚不存在,可以使用 POST 方法生成一个。

示例 URI

GET /api/authorization

请求

标头

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

响应 200

标头

Content-Type: application/jsonLink: <http:/api.prodsmart.com/api/authorizations>;rel="self"

主体

{    "_links": {        "self": { "href": "/api/authorizations" },    },    "scopes": [        "productions_write"    ],    "token": "abc123"}

创建授权

POST /api/authorization

使用 POST 生成新的访问令牌。

示例 URI

POST /api/authorization

请求

标头

Content-Type: application/jsonAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

主体

{ "scopes": [ "productions_write" ] }

响应 201

标头

Content-Type: application/jsonLink: <http:/api.prodsmart.com/api/authorizations>;rel="self"

主体

{    "_links": {        "self": { "href": "/api/authorizations" },    },    "scopes": [        "productions_write"    ],    "token": "abc123"}

移除授权

DELETE /api/authorization

示例 URI

DELETE /api/authorization

请求

标头

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

响应 204

这是否解答了您的问题?