Create work order
post
/productionMonitoring/clientapi/v2/workOrders
This operation creates a new instance of a work order. A work order refers to a document that conveys the authority for the production of a specific product.
Request
Supported Media Types
- application/json
Header Parameters
-
X-ORACLE-IOT-ORG: string
To allow targeting requests to different organizations. The header value should contain the organization identifier
Root Schema : WorkOrder_create
Type:
Show Source
object
-
actualEndTime(optional):
integer
Actual finish date of the work order as an epoch milliseconds
-
actualStartTime(optional):
integer
Actual start date of the work order as an epoch milliseconds
-
batchQuantity(optional):
integer
Batch quantity for the work order. Applicable only for Process Work Order
-
batchUOM(optional):
string
Unit of measure of the batch quantity. Applicable only for Process Work Order
-
description(optional):
string
Description of the work order.
-
externalId(optional):
string
External id representing value that uniquely identifies the work order in an external system
-
factory:
string
A factory this work order belongs to
-
name:
string
Name that identifies the work order
-
plannedEndTime:
integer
Scheduled date and time to finish the work order as an epoch milliseconds
-
plannedQuantity:
integer
Planned production quantity for the work order
-
plannedStartTime:
integer
Scheduled date and time to start the work order as an epoch milliseconds
-
primaryUOM(optional):
string
Unit of measure of the primary product. Applicable only for Process Work Order
-
product:
string
A product identifier that the work order creates
-
state(optional):
string
The user-defined name for the work order state. The field contains the system value of the work order state by default.
-
systemState:
string
Name of the work order system state. This represents the state of the work order during its life cycle. One of [CREATED, PLANNED, UNRELEASED, RELEASED, IN_PROCESS, COMPLETED, CLOSED, CANCELLED].
-
type(optional):
string
Type of the work order state. One of [STANDARD, NON_STANDARD, TRANSFORM, REWORK]. Default value is STANDARD.
-
workMethod(optional):
string
The production method used in the work order, one of ['DISCRETE_MANUFACTURING', 'PROCESS_MANUFACTURING']
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
201 Response
Successfully processed.
Root Schema : WorkOrder_receive
Type:
Show Source
object
-
actualEndTime:
integer
Actual finish date of the work order as an epoch milliseconds
-
actualEndTimeAsString:
integer
Actual finish date of the work order as an ISO-8601 formatted string
-
actualStartTime:
integer
Actual start date of the work order as an epoch milliseconds
-
actualStartTimeAsString:
integer
Actual start date of the work order as an ISO-8601 formatted string
-
batchQuantity:
integer
Batch quantity for the work order. Applicable only for Process Work Order
-
batchUOM:
string
Unit of measure of the batch quantity. Applicable only for Process Work Order
-
createdBy:
string
Name of the user who registered this work order
-
createdTime:
integer
The time when the work order was registered with the app as an epoch milliseconds
-
createdTimeAsString:
integer
The time when the work order was registered with the app as an ISO-8601 formatted string
-
description:
string
Description of the work order.
-
externalId:
string
External id representing value that uniquely identifies the work order in an external system
-
factory:
string
A factory this work order belongs to
-
id:
string
The unique identifier of the work order
-
integrationId:
string
The integration identifier that imported the work order
-
lastModifiedBy:
string
Name of the user who last modified the definition of the work order
-
lastModifiedTime:
integer
The time when the work order definition was last updated as an epoch milliseconds
-
lastModifiedTimeAsString:
integer
The time when the work order definition was last updated as an ISO-8601 formatted string
-
name:
string
Name that identifies the work order
-
operations:
object operations
The list of operations are used to process the work order
-
plannedEndTime:
integer
Scheduled date and time to finish the work order as an epoch milliseconds
-
plannedEndTimeAsString:
integer
Scheduled date and time to finish the work order as an ISO-8601 formatted string
-
plannedQuantity:
integer
Planned production quantity for the work order
-
plannedStartTime:
integer
Scheduled date and time to start the work order as an epoch milliseconds
-
plannedStartTimeAsString:
integer
Scheduled date and time to start the work order as an ISO-8601 formatted string
-
primaryUOM:
string
Unit of measure of the primary product. Applicable only for Process Work Order
-
product:
string
A product identifier that the work order creates
-
routing:
string
The production routing identifier
-
state:
string
The user-defined name for the work order state. The field contains the system value of the work order state by default.
-
systemState:
string
Name of the work order system state. This represents the state of the work order during its life cycle. One of [CREATED, PLANNED, UNRELEASED, RELEASED, IN_PROCESS, COMPLETED, CLOSED, CANCELLED].
-
type:
string
Type of the work order state. One of [STANDARD, NON_STANDARD, TRANSFORM, REWORK]. Default value is STANDARD.
-
workMethod:
string
The production method used in the work order, one of ['DISCRETE_MANUFACTURING', 'PROCESS_MANUFACTURING']
Nested Schema : operations
Type:
object
The list of operations are used to process the work order
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : items
Type:
Show Source
object
-
href(optional):
string
The target resource URIExample:
https://iotserver/iot/api/vX/some/API/path
-
rel(optional):
string
Relation typeExample:
canonical
400 Response
Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
401 Response
Unauthorized. The request requires user authentication.
403 Response
Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-H 'Content-Type: application/json'
https://iotserver/productionMonitoring/clientapi/v2/workOrders
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"actualEndTime":1469184297746,
"actualStartTime":1469184297746,
"batchQuantity":12345,
"batchUOM":"Unit of measure of the batch quantity. Applicable only for Process Work Order",
"description":"Description of the work order.",
"externalId":"5dfc7f41996-4d39",
"factory":"A factory this work order belongs to",
"name":"Name that identifies the work order",
"plannedEndTime":1469184297746,
"plannedQuantity":12345,
"plannedStartTime":1469184297746,
"primaryUOM":"Unit of measure of the primary product. Applicable only for Process Work Order",
"product":"A product identifier that the work order creates",
"state":"The user-defined name for the work order state. The field contains the system value of the work order state by default.",
"systemState":"Name of the work order system state. This represents the state of the work order during its life cycle. One of [CREATED, PLANNED, UNRELEASED, RELEASED, IN_PROCESS, COMPLETED, CLOSED, CANCELLED].",
"type":"Type of the work order state. One of [STANDARD, NON_STANDARD, TRANSFORM, REWORK]. Default value is STANDARD.",
"workMethod":"'DISCRETE_MANUFACTURING'"
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"actualEndTime":1469184297746,
"actualEndTimeAsString":1469184297746,
"actualStartTime":1469184297746,
"actualStartTimeAsString":1469184297746,
"batchQuantity":12345,
"batchUOM":"Unit of measure of the batch quantity. Applicable only for Process Work Order",
"createdBy":"Name of the user who registered this work order",
"createdTime":1469184297746,
"createdTimeAsString":1469184297746,
"description":"Description of the work order.",
"externalId":"5f442e42f5f-21fa",
"factory":"A factory this work order belongs to",
"id":"791711663a6-4360",
"integrationId":"5b371115652b-6f81",
"lastModifiedBy":"Name of the user who last modified the definition of the work order",
"lastModifiedTime":1469184297746,
"lastModifiedTimeAsString":1469184297746,
"name":"Name that identifies the work order",
"operations":{
"links":[
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"plannedEndTime":1469184297746,
"plannedEndTimeAsString":1469184297746,
"plannedQuantity":12345,
"plannedStartTime":1469184297746,
"plannedStartTimeAsString":1469184297746,
"primaryUOM":"Unit of measure of the primary product. Applicable only for Process Work Order",
"product":"A product identifier that the work order creates",
"routing":"The production routing identifier",
"state":"The user-defined name for the work order state. The field contains the system value of the work order state by default.",
"systemState":"Name of the work order system state. This represents the state of the work order during its life cycle. One of [CREATED, PLANNED, UNRELEASED, RELEASED, IN_PROCESS, COMPLETED, CLOSED, CANCELLED].",
"type":"Type of the work order state. One of [STANDARD, NON_STANDARD, TRANSFORM, REWORK]. Default value is STANDARD.",
"workMethod":"'DISCRETE_MANUFACTURING'"
}
Complete cURL Example
The following example shows a complete cURL command that you can use to perform the described operation:
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-d '{"actualEndTime":1469184297746,"actualStartTime":1469184297746,"batchQuantity":12345,"batchUOM":"Unit of measure of the batch quantity. Applicable only for Process Work Order","description":"Description of the work order.","externalId":"5dfc7f41996-4d39","factory":"A factory this work order belongs to","name":"Name that identifies the work order","plannedEndTime":1469184297746,"plannedQuantity":12345,"plannedStartTime":1469184297746,"primaryUOM":"Unit of measure of the primary product. Applicable only for Process Work Order","product":"A product identifier that the work order creates","state":"The user-defined name for the work order state. The field contains the system value of the work order state by default.","systemState":"Name of the work order system state. This represents the state of the work order during its life cycle. One of [CREATED, PLANNED, UNRELEASED, RELEASED, IN_PROCESS, COMPLETED, CLOSED, CANCELLED].","type":"Type of the work order state. One of [STANDARD, NON_STANDARD, TRANSFORM, REWORK]. Default value is STANDARD.","workMethod":"'DISCRETE_MANUFACTURING'"}'
https://iotserver/productionMonitoring/clientapi/v2/workOrders
Note that in the request,
https://iotserver
will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is
https://myinstance-myidentitydomain.iot.us.oraclecloud.com
and the default port is 443.