Skip to content

Smart Shop Floor APIs

Postman

Attached below is the updated Postman collection with all OpenAPIs and request and response examples for each API (same as ones in documentation).

This collection containts all SmartShopFloor OpenAPIs that are available to use to retrieve, update or delete data in your SSF portal. Before executing any requests, go to the "variables" section of this collection and input your SSF API URL and SSF API KEY into the corresponding variables, which every API will use to execute the requests.

Click here to download the postman collection for accessing the API's via postman. Import the collection and setup the collection variables as per your portal configurations.

Get All Work Centers

Path

GET /api/2.0/getAllWorkcentres

Description

Retrieves a list containing all WorkCentres within the portal and provides the WorkCentre's ID and Name, The ID and Name of the Department the WorkCentre is assigned to, the ID, Name and Tag of the Category the WorkCentre is assigned to and the Department's Tag.

This API request is a GET request and does not have any parameters.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

N/A

Request Example:

1.Retrieve all work centres in SSF portal:

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllWorkcentres

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
workcentres List of workcentres saved in SSF.
workcentres.workcentreId Unique ID of the work centre
workcentres.workcentre Name of the work center.
workcentres.departmentId ID of the department where the work centre is located.
workcentres.department Name of the department where the work centre is located.
workcentres.categoryId ID of the category where the work centre is located.
workcentres.categoryName Name of the category where the work centre is located.
workcentres.tag Value provided in the tag field of the work centre page. Use this to link the 3rd party system work centre id.
workcentres.categoryTag Value provided in the tag field of the category page. Use this to link the 3rd party system category to SSF category.

Response Example (200 OK)

1.Retrieve all workcentres:

{
    "workcentres": [
        {
            "workcentreId": "64cb3aefd670630006460188",
            "workcentre": "Blasting Unit",
            "departmentId": "650d03226207e200076d383f",
            "department": "Blasting",
            "categoryId": "64dae1cc8acfc10008897018",
            "categoryName": "Blasting",
            "tag": "",
            "categoryTag": "Blt"
        },
        {
            "workcentreId": "64cb3b25d670630006460390",
            "workcentre": "Powdercoating Booth",
            "departmentId": "650d03376207e200076d393e",
            "department": "Powder Coating",
            "categoryId": "64dae1d68acfc1000889705f",
            "categoryName": "Powder coating",
            "tag": "",
            "categoryTag": ""
        },
        {
            "workcentreId": "67a1a90a6969a4efcdad8cb8",
            "workcentre": "Dispatch Configuration",
            "departmentId": "64cb2955d67063000645dbbe",
            "department": "Drafting",
            "categoryId": "64dae2128acfc10008897252",
            "categoryName": "Lathing",
            "tag": "CRD",
            "categoryTag": ""
        },
        {
            "workcentreId": "67a43b0729384d3ed610308b",
            "workcentre": "Design Bench",
            "departmentId": "66ecd0c35786192d01192b87",
            "department": "Design",
            "categoryId": "64dae1cc8acfc10008897018",
            "categoryName": "Blasting",
            "tag": "DSGN",
            "categoryTag": "Blt"
        }
    ]
}

Get Work Centre Utilisation

Path

GET /api/2.0/getWorkcentreUtilisation?workcentreId=[WorkCentreID]&startDate=[StartDate]&endDate=[EndDate]&shiftNumber=[ShiftNumber]

Description

Retrieves every status assigned to the requested Work Centre after the date specified in the request.

The API requires the user to provide a WorkCentre ID which represents the ID of the WorkCentre that will return a list of statuses assigned to it. The API also requires the user to provide a Start Date that will further return the list of statuses assigned to the Work Center after this date provided, and the user can choose to provide an End Date to retrieve any data between the start and end date or not provide an end date, returning all data from the start date onwards. Therefore, the API requires at a bare minimum that the WorkCentre ID and the startDate to be provided in the API request.

The user can also provide a shift number if they want the API to only return Work Centre statuses that were assigned during a specific shift.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

Key Value
workcentreId (required) ID of the workcentre that you’re requesting utilisation/status information from.
startDate (required) Defines the beginning of a date range for exporting job data. Formatted as yyyy-MM-dd.
endDate (Optional) Defines the end of a date range for exporting job data. Formatted as yyyy-MM-dd.
shiftNumber (Optional) Defines an ID of a worker’s shift which will retrieve all WorkCentre status information for the specified shift only.

Request Example:

1.Get WorkCentre Utilisation using WorkCentre ID, Start and End Date

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkcentreUtilisation?workcentreId=64cb395ad67063000645f445&startDate=2025-01-01T10:30:00Z&endDate=2025-01-10T10:30:00Z

2.Get WorkCentre Utilisation using WorkCentre ID, Shift Number, Start and End Date

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkcentreUtilisation?workcentreId=64cb395ad67063000645f445&startDate=2025-01-01T10:30:00Z&endDate=2025-01-10T10:30:00Z&shiftNumber=10000001

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
message An output message from the API. Occurs when there is no data returned from a successful query or when there the API request returns a 400 Bad Request code.
query List of the parameters the user included in the API request.
statuses List of the Work Centre status that meet the parameters passed in the API.
statuses.date Date when the Work Centre was assigned this status.
statuses.statusId ID of a status that was assigned to the Work Centre.
Statuses.statusName Name of a status that was assigned to the Work Centre
statuses.duration Duration that the status was assigned to the Work Centre.
statuses.type Type of status that was assigned to the Work Centre.
statuses.code Job code that assigned the status to the Work Centre (when applicable).

Response Example (200 OK)

1.Valid GET request with data meeting request parameters:

{
    "message": "",
    "query": {
        "workcentreId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01T10:30:00Z",
        "endDate": "2025-01-10T10:30:00Z",
        "shiftNumber": 10000001
    },
    "statuses": [
        {
            "date": "2025-01-08T14:14:37.000Z",
            "statusId": "64e47c28a9e0fe0007451313",
            "statusName": "Utilised",
            "duration": 36,
            "type": "uptime",
            "code": "DT-10001"
        },
        {
            "date": "2025-01-08T14:12:15.000Z",
            "statusId": "64e47c28a9e0fe0007451313",
            "statusName": "Utilised",
            "duration": 88,
            "type": "uptime",
            "code": "DT-10001"
        },
        {
            "date": "2025-01-08T06:53:09.000Z",
            "statusId": "64e47c28a9e0fe0007451313",
            "statusName": "Utilised",
            "duration": 17,
            "type": "uptime",
            "code": "DT-10001"
        },
        {
            "date": "2025-01-08T14:13:50.000Z",
            "statusId": "64d442a5e5f31a00072a27b9",
            "statusName": "Idle",
            "duration": 47,
            "type": "downtime",
            "code": ""
        }
    ]
}

2.Valid GET request with no data satisfying request parameters:

{
    "message": "No Data",
    "query": {
        "workcentreId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01T10:30:00Z",
        "endDate": "2025-01-10T10:30:00Z",
        "shiftNumber": "10000001"
    },
    "statuses": []
}

Response Example (400 Bad Request)

1.Missing Work Centre ID:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Workcentre not found"
}

2.Missing Start Date:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "startDate missing"
}

3.Invalid Work Centre ID:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "workcentreId not valid"
}

4.Invalid Start and/or End Date:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Invalid date format - use YYYY-MM-DD only"
}

5.End Date before Start Date:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Dates not valid"
}

Get Work Centre Work

Path

GET /api/2.0/getMachineWork?machineId=[MachineID]&startDate=[StartDate]&endDate=[EndDate]

Description

This API will retrieve all instances of work being performed using a Machine specified and within a date range.

The API requires a Machine ID (ID for a Work Center) to be provided which represents the ID of the Work Centre that will return a list of all instances of work being performed on it. The API also requires the user to provide a Start Date that will filter the list of work performed instances to all instances that occurred after the start date.

Additionally, the API can optionally include an End Date where the list of instances will be filtered to where the returned instances of work will have been performed between the start and end date, or alternatively the user can choose to not include an End Date which will return all data since the start date.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

Key Value
machineId (required) ID of the workcentre that you’re requesting work information from. (Can be found using the getAllWorkCentres API)
startDate (required) Defines the beginning of a date range for exporting job data. Formatted as yyyy-MM-dd.
endDate Defines the end of a date range for exporting job data. Formatted as yyyy-MM-dd.

Request Example:

1.Get WorkCentre Work using WorkCentre ID, Start and End Date

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getMachineWork?machineId=64cb395ad67063000645f445&startDate=2025-01-01T10:30:00Z&endDate=2025-01-20T10:30:00Z

Responses

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
message An output message from the API. Occurs when there is no data returned from a successful query or when there the API request returns a 400 Bad Request code.
query List of the parameters the user included in the API request.
jobs List of the work performed on the specified Work Centre that meet the parameters passed in the API.
jobs.fromTime Date and Time that the instance of work retrieved started on the Work Centre.
jobs.toTime Date and Time that the instance of work retrieved finished on the Work Centre.
Jobs.duration Duration for the instance of work retrieved on the specified Work Centre.
jobs.code Job code of the instance of work completed on the specified Work Centre.
jobs.component Component name of the instance of work completed on the specified Work Centre.
jobs.operation Operation name of the instance of work completed on the specified Work Centre.
machine Details of the Work Centre the user has requested work data for including the id (_id), name (name), department (workcentre) and category (category).

Response Example (200 OK)

1.Valid GET request with data meeting request parameters:

{
    "message": "",
    "query": {
        "machineId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01T10:30:00Z",
        "endDate": "2025-01-20T10:30:00Z"
    },
    "jobs": [
        {
            "fromTime": "2025-01-20T12:24:21Z",
            "toTime": "2025-01-20T12:24:23Z",
            "duration": 2,
            "code": "N-200125-1",
            "component": "9-200100-013",
            "operation": "Drawing and Design"
        },
        {
            "fromTime": "2025-01-20T11:55:59Z",
            "duration": null,
            "code": "DT-00121",
            "component": "9-120105-010",
            "operation": "Drawing and Design"
        },
        {
            "fromTime": "2025-01-07T15:01:05Z",
            "toTime": "2025-01-08T06:53:28Z",
            "duration": 41,
            "code": "DT-10001",
            "component": "9-200100-013",
            "operation": "Drawing and Design"
        }
    ],
    "machine": {
        "_id": "64cb395ad67063000645f445",
        "name": "Drafting and Design",
        "workcentre": "Drafting",
        "category": "Machining"
    }
}

2.Valid GET request with no data satisfying request parameters:

{
    "message": "No Data.",
    "query": {
        "machineId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01T10:30:00Z",
        "endDate": "2025-01-01T10:30:00Z"
    },
    "jobs": [],
    "machine": {
        "_id": "64cb395ad67063000645f445",
        "name": "Drafting and Design",
        "workcentre": "Drafting",
        "category": "Machining"
    }
}

Response Example (400 Bad Request)

1.Missing Work Centre ID:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Machine not found"
}

2.Missing Start Date:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "startDate missing"
}

3.Invalid Work Centre ID:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Machine not valid"
}

4.Invalid Start and/or End Date:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Invalid date format - use YYYY-MM-DD only"
}

5.Invalid Date Range (EG: End Date before Start Date):

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Dates not valid"
}

Get All Departments

Path

GET /api/2.0/getAllDepartments

Description

Retrieves a list containing all Departments within the portal and provides each Department’s ID, Name, Short Name and Tag that is assigned to it.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

N/A

Request Example:

    https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllDepartments

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
departments List of departments saved in SSF.
departments.departmentId Id of the department.
departments.department Name of the department.
departments.shortName Short name of the department.
departments.tag Value provided in the tag field of the department page. Use this to link the 3rd party system department ID.

Response Example (200 OK)

1.Retrieve all departments:

{
    "departments": [
        {
            "departmentId": "62298c695743580006dbc8e4",
            "department": "Camshaft",
            "shortName": "Cams",
            "tag": "67"
        },
        {
            "departmentId": "62d661e46761510009780f06",
            "department": "Roll",
            "shortName": "Roll",
            "tag": "Rolling"
        },
        {
            "departmentId": "62d662596761510009780f0b",
            "department": "Fabrication",
            "shortName": "Fabric",
            "tag": "Fabrication"
        }
    ]
}

Get All Categories

Path

GET /api/2.0/getCategories

Description

Retrieves a list containing all Categories within the portal and provides each Category’s ID, Name and Tag that is assigned to it.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

N/A

Request Example:

    https://[SubDomain].smartshopfloor.cloud/api/2.0/getCategories

Responses

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
categories List of categories saved in SSF.
categories.categoryId Id of the category.
categories.category Name of the category.
categories.tag Value provided in the tag field of the category page. Use this to link the 3rd party system category ID.

Response Example (200 OK)

1.Retrieve all categories:

{
    "categories": [
        {
            "categoryId": "610518a402472c000d4ed901",
            "category": "Operations",
            "tag": null
        },
        {
            "categoryId": "628f4332ec3148000a95151b",
            "category": "Cyl Heads",
            "tag": "CHS"
        }
    ]
}

Get Utilisation

Path

GET /api/2.0/getUtilisation?machineId=[WorkCentreID]&startDate=[StartDate]&endDate=[EndDate]&shiftNumber=[ShiftNumber]

Description

This API will retrieve the utilisation information for a given workcentre using the machine ID provided in the request. The API will retrieve each instance that the workcentre has been assigned a specific status and will return the date the status was assigned, what specific status and type of status was assigned, the duration the status was assigned and the job code for the job responsible for the status assignment (if applicable). The request requires the ID of the workcentre to be included in the body of the request along with a “startDate“ date, where the API will retrieve all information for the workcentre since this date.

The API optionally can include an “endDate“ date to make the API return information between the provided start and end dates, or no “endDate” can be included to make the API return all information from the start date to the current date. Finally, the API can also include a shift number which will ensure the API returns information for the workcentre that only refer to the specified shift.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

Field Description
machineId ID of the WorkCentre that the API will find utilisation information for.
startDate Start date for the date range the API will return utilisation information for.
endDate (optional) End date for the date range the API will return utilisation information for.
shiftNumber (optional) Shift Number that the API will use to return all utilisation details for a workcentre that occurred during this shift.

Request Example:

1.Request using Machine ID, Start Date and End Date

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getUtilisation?machineId=64cb395ad67063000645f445&startDate=2025-01-01&endDate=2025-01-10

2.Request using Machine ID, Start Date, End Date and Shift Number

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getUtilisation?machineId=64cb395ad67063000645f445&startDate=2025-01-01&endDate=2025-01-10&shiftNumber=100000

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields

Field Description
message Message from the API regarding the result of the request.
query Returns all request parameters provided in the request by the user.
statuses List of instances the specified work centre has been assigned a status.
statuses.date Date that the status has been assigned to the work centre.
statuses.statusId ID of the status that has been assigned to the work centre.
statuses.statusName Name of the status that has been assigned to the work centre.
statuses.duration Duration, in seconds, that the status was assigned to the work centre.
statuses.type Type of status that was assigned to the work centre.
statuses.code Job code that was responsible for the status assignment (if applicable).

Response Example (200 OK)

1.Valid request with data meeting requirements provided in parameters:

{
    "message": "",
    "query": {
        "machineId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01",
        "endDate": "2025-01-10",
        "shiftNumber": null
    },
    "statuses": [
        {
            "date": "2025-01-08T14:12:15.000Z",
            "statusId": "64e47c28a9e0fe0007451313",
            "statusName": "Utilised",
            "duration": 1000,
            "type": "uptime",
            "code": "ExampleABC123_2"
        },
        {
            "date": "2025-01-08T06:53:09.000Z",
            "statusId": "64e47c28a9e0fe0007451313",
            "statusName": "Utilised",
            "duration": 2500,
            "type": "uptime",
            "code": "ExampleABC123_1"
        },
        {
            "date": "2025-01-09T15:55:01.000Z",
            "statusId": "64e47c28a9e0fe000745130d",
            "statusName": "No Operator",
            "duration": 937759,
            "type": "downtime",
            "code": ""
        },
        {
            "date": "2025-01-08T14:28:55.000Z",
            "statusId": "64d442a5e5f31a00072a27b9",
            "statusName": "Idle",
            "duration": 91566,
            "type": "downtime",
            "code": ""
        },
        {
            "date": "2025-01-08T07:34:09.000Z",
            "statusId": "64d442a5e5f31a00072a27b9",
            "statusName": "Idle",
            "duration": 23886,
            "type": "downtime",
            "code": ""
        }
    ]
}

2.Valid request with no data meeting requirements provided in parameters:

{
    "message": "No Data",
    "query": {
        "machineId": "64cb395ad67063000645f445",
        "startDate": "2025-01-01",
        "endDate": "2025-01-01",
        "shiftNumber": null
    },
    "statuses": []
}

Request Example (400 Bad Request)

1.Invalid date range provided:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Dates not valid"
}

2.Start date missing:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "startDate missing"
}

3.Invalid date format provided for a date value:

    "statusCode": 400,
    "error": "Bad Request",
    "message": "Invalid date format - use YYYY-MM-DD only"
}

4.Machine ID not provided:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "machineId not found"
}

5.Invalid Machine ID provided:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "machineId not valid"
}

Get All Workcenters

Path

GET /api/2.0/getAllWorkcentres

Description

Retrieves a list containing all WorkCentres within the portal and provides the WorkCentre's ID and Name, The ID and Name of the Department the WorkCentre is assigned to, the ID, Name and Tag of the Category the WorkCentre is assigned to and the Department's Tag.

This API request is a GET request and does not have any parameters.

Request Headers:

Key Value
content-type “application/json”
ApiKey API key provided for API usage.

Request Parameters:

N/A

Request Example:

Retrieve all work centres in SSF portal:

    GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllWorkcentres

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
workcentres List of workcentres saved in SSF.
workcentres.workcentreId Unique ID of the work centre
workcentres.workcentre Name of the work center.
workcentres.departmentId ID of the department where the work centre is located.
workcentres.department Name of the department where the work centre is located.
workcentres.categoryId ID of the category where the work centre is located.
workcentres.categoryName Name of the category where the work centre is located.
workcentres.tag Value provided in the tag field of the work centre page. Use this to link the 3rd party system work centre id.
workcentres.categoryTag Value provided in the tag field of the category page. Use this to link the 3rd party system category to SSF category.

Response Sample:

1.Retrieve all workcentres:

{
    "workcentres": [
        {
            "workcentreId": "64cb3aefd670630006460188",
            "workcentre": "Blasting Unit",
            "departmentId": "650d03226207e200076d383f",
            "department": "Blasting",
            "categoryId": "64dae1cc8acfc10008897018",
            "categoryName": "Blasting",
            "tag": "",
            "categoryTag": "Blt"
        },
        {
            "workcentreId": "64cb3b25d670630006460390",
            "workcentre": "Powdercoating Booth",
            "departmentId": "650d03376207e200076d393e",
            "department": "Powder Coating",
            "categoryId": "64dae1d68acfc1000889705f",
            "categoryName": "Powder coating",
            "tag": "",
            "categoryTag": ""
        },
        {
            "workcentreId": "67a1a90a6969a4efcdad8cb8",
            "workcentre": "Dispatch Configuration",
            "departmentId": "64cb2955d67063000645dbbe",
            "department": "Drafting",
            "categoryId": "64dae2128acfc10008897252",
            "categoryName": "Lathing",
            "tag": "CRD",
            "categoryTag": ""
        },
        {
            "workcentreId": "67a43b0729384d3ed610308b",
            "workcentre": "Design Bench",
            "departmentId": "66ecd0c35786192d01192b87",
            "department": "Design",
            "categoryId": "64dae1cc8acfc10008897018",
            "categoryName": "Blasting",
            "tag": "DSGN",
            "categoryTag": "Blt"
        }
    ]
}

Create Job

Path

POST /api/2.0/postJob

Description

Create a new production or stock job using this API in the SSF portal. The API requires the new job to be created with a unique job code, meaning if you try to create a job with a Job Code that is already allocated by an existing Job, the API will update that Job with the information in the request body rather than creating a new job. The API will create a new job using the data provided in the request body which must include a value for “code” and a “dueDate“ for each operation added (fields described below). All other fields can be either assigned values, assigned null or not assigned any values and be assigned its default value. Otherwise, like previously stated, if the job code provided in the request body is already assigned to a job, this job will be updated with the values provided in the requst.

Note: When updating an existing job, any components in the request body will be added as a new component unless there is an existing job component that has the same Component Name, Operation Name, Department ID, Category ID and WorkCentre ID, where in this scenario the existing component will be updated.

Request Headers:

Key Value
content-type application/json
ApiKey API key provided for API usage.

Request Parameters:

Field description
code (required) Unique job code
meta The metadata pertaining to a job will be entered here. This fields are dynamic and can vary from client to client basis. They can be fetched from the getMeta API.
components Defines the array of components and operations to be performed in the job.
name The name of the component.
operation the name of the operation
departmentId The id of the department where the operation needs to be performed. The departmentId can be fetched from the getAllDepartments API.
categoryId The category of the workcentre where the operation is to be performed
workcentreId The id of the workcentre where the operation is to be performed. Use the getAllWorkcentres API to find relevant workcentreId.
workInstruction Instructions associated to the particular operation.
dueDate (required) Date by which the operation needs to be completed.
status Current status of the component
quantity Number of components or parts to be worked on.
priority Priority of the job/component
sequenceNo Sequence at which the operation would execute.
prevComp The previous operation for maintaining a sequence.
group Provide a group name when the operations are to be performed on the same work centre as a group
duration Estimated duration in minutes is the time it take an operation to complete.

Request Example:

1.Create Production Job

POST https://[SubDomain].smartshopfloor.cloud/api/2.0/postJob 

REQUEST BODY:
{
    "code": "Example123ABC",
    "jobInstruction": null,
    "meta": {
        "serialNo": "SR123ABC",
        "model": "ABC_1",
        "customerName": "ABC Corp",
        "orderNo": "1234567",
        "contactName": "ABC Corp Pty Ltd",
        "email": "abc@abc.com"
    },
    "components": [
        {
            "name": "CRANK",
            "operation": "Assembly",
            "categoryId": "64dae20b8acfc1000889720b",
            "workcentreId": "65290109a26631000857f7dc",
            "departmentId": "650d03506207e200076d3a00",
            "workInstruction": "Some description.",
            "dueDate": "2025-01-01",
            "status": "active",
            "priority": "2",
            "quantity": "4",
            "sequenceNo": "2",
            "group": null,
            "prevComp": null,
            "duration": 120
        }
    ]
}

2.Create Stock Job

POST https://[SubDomain].smartshopfloor.cloud/api/2.0/postJob 

{
    "code": "ExampleStockABC",
    "jobInstruction": null,
    "jobType": "stock",
    "stockreqqty": 1,
    "dueDate": "2025-01-01",
    "meta": {
        "serialNo": "SRStockABC",
        "model": "ABC_1",
        "customerName": "ABC Corp",
        "orderNo": "1234567",
        "contactName": "ABC Corp Pty Ltd",
        "email": "abc@abc.com"
    },
    "components": [
        {
            "name": "Comp One",
            "quantity": 1
        },
        {
            "name": "Comp Two",
            "quantity": 2
        }
    ]
}

Responses:

Response Code Outcome
200 OK Success.
400 Bad Request The server could not understand your search terms for the API.
401 Unauthorised You did not provide the correct authentication to access this API.
403 Forbidden You do not have the correct permissions to access this API.
404 Not Found The API information requested could not be found.
504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

Response Fields:

Field Description
message Displays a message in certain instances. E.g. "job imported successfully"
jobId Returns the job Id which got created

Response Example (200 OK)

1.Create Valid Production/Stock Job:

{
    "message": "Job imported successfully.",
    "job": "62d6807f3776485754af87ee"
}

Response Example (400 Bad Request)

1.Missing operation(s) in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"operation\" is not allowed to be empty"
}

2.Missing Job Code in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"code\" is not allowed to be empty"
}

3.Missing Component Name for an Operation/Component in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"name\" is not allowed to be empty"
}

4.Missing or invalid Due Date for an Operation/Component in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"dueDate\" must be a valid ISO 8601 date"
}

5.Invalid WorkCentre ID provided for an Operation/Component in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "WorkCenter not found, for component CRANK"
}

6.Invalid Category or Department ID provided for an Operation/Component in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Object ID error"
}

7.No WorkCentre or Department provided for an Operation/Component in API Request Body:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Department or Work Centre is required"
}

Note: For example 7 (No WorkCentre or Department provided for an Operation/Component in API Request Body), a Create Job API will work with an operation not having an assigned Department and Work Centre if the job and operation already exists in SmartShopFloor as the API will update the existing operation instead of create a new operation.

Create Job Using Template Code

Path

POST /api/2.0/createJob

Description

Create a new job based off a template code provided using this API in the SSF portal. If the job posted already exists, then the existing job will be updated. Using this API, jobs can be created using one or more existing job templates by providing the job template code for all templates being imported and (optionally) a quantity for the operations within each job code.

The API requires a value to be assigned for “code” and “dueDate” in the request body as well as at least one template code provided as “templateCode“. All other fields are optional and can be included or be left null/assigned the field’s default value.

Request Headers:

Key Value
content-type application/json
ApiKey API key provided for API usage.

Request Parameters:

Field Description
dueDate (required) Date by which the operation needs to be completed. This field can be entered as a date
  • DueDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • jobInstruction Instructions for the job being created.
    priority Priority of the job/component
    stockreqqty Required quantity for the stock job being created.
    meta The metadata pertaining to a job will be entered here. This fields are dynamic and can vary from client to client basis. They can be fetched from the getJobMeta API.
    jobType The type of job provided.
    templateCode (required) Unique code for the template code that the job creation will be based off.
    code (required) Unique job code

    Request Example:

    1.Create a production job using one template code with default quantity:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createJob 
    
    REQUEST BODY:
    {
        "code": "324234",
        "priority": null,
        "dueDate": "2025-07-01T16:00:00Z",
        "jobInstruction": "",
        "templateCode": "K-12345",
        "meta": {
            "description": "Desc",
            "customer": "Cust Name",
            "orderNo": "1",
            "serialNo": "1",
            "quoteNo": "1",
            "type": "TRAYS",
            "jobCategory": "Cat",
            "jobRef": "Ref"
        }
    }
    

    2.Create a production job using one template code with specified quantity:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createJob
    
    REQUEST BODY:
    {
        "code": "Example123ABC",
        "jobInstruction": null,
        "dueDate": "2025-01-01",
        "priority": 3,
        "templateCode": [
            {
                "code": "9-521000-010",
                "qty": 2
            }
        ],
        "meta": {
            "description": "Job Description",
            "serialNo": "SR123ABC",
            "orderNo": "1234567",
            "model": "ABC_1",
            "customerName": "ABC Corp",
            "contactName": "ABC Corp Pty Ltd",
            "email": "abc@abc.com",
            "type": "TRAYS",
            "jobCategory": "PARTS SALES",
            "buildNo": "DT1063",
            "estimatedHours": 15
        }
    }
    
    

    3.Create a production job using multiple template codes with default quantity:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createJob 
    
    REQUEST BODY:
    {
        "code": "Example123ABC",
        "jobInstruction": null,
        "dueDate": "2025-01-01",
        "priority": 3,
        "templateCode": ["9-521000-010", "9-521000-020"],
        "meta": {
            "description": "Job Description",
            "serialNo": "SR123ABC",
            "orderNo": "1234567",
            "model": "ABC_1",
            "customerName": "ABC Corp",
            "contactName": "ABC Corp Pty Ltd",
            "email": "abc@abc.com",
            "type": "TRAYS",
            "jobCategory": "PARTS SALES",
            "buildNo": "DT1063",
            "estimatedHours": 15
        }
    }
    

    4.Create a production job using multiple template codes with custom quantity:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createJob 
    
    REQUEST BODY:
    {
        "code": "Example123ABC",
        "jobInstruction": null,
        "dueDate": "2025-01-01",
        "priority": 3,
        "templateCode": [
            {
                "code": "9-521000-010",
                "qty": 2
            },
            {
                "code": "9-521000-020",
                "qty": 5
            }
        ],
        "meta": {
            "description": "Job Description",
            "serialNo": "SR123ABC",
            "orderNo": "1234567",
            "model": "ABC_1",
            "customerName": "ABC Corp",
            "contactName": "ABC Corp Pty Ltd",
            "email": "abc@abc.com",
            "type": "TRAYS",
            "jobCategory": "PARTS SALES",
            "buildNo": "DT1063",
            "estimatedHours": 15
        }
    }
    

    Responses

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a response message for the API request. E.g. "job imported successfully".
    job Returns the Job ID which got created.

    Response Example (200 OK)

    1.Job creation with a template code successful:

    {
        "message": "Job imported successfully.",
        "job": "646edb09845f2d426c215e40"
    }
    

    Response Example (400 Bad Request)

    1.Template code provided in request body is invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job Template is missing or not found in the SmartShopFloor portal."
    }
    

    2.Job code not provided in request body:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job template code is missing in the import file."
    }
    

    3.Job Code not provided in request body:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job code is missing in the import file."
    }
    
    

    4.Due Date not provided in request body:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Due date is missing in the import file."
    }
    

    Get Dispatch Jobs

    Path

    POST /api/2.0/dispatchedJobs

    Description

    The API will process, and dispatch one or more jobs based on the job codes provided in the API request. The user must provide the API with a list of job codes for all jobs that they want to process and dispatch. The API will execute this process by first closing all jobs provided in the request’s 'jobs' list and dispatch them for delivery.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Field Description
    jobs List of job codes for the jobs that will be completed in SSF.

    Request Example:

    1.Competing one job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/dispatchedJobs
    
    REQUEST BODY:
    {
      "jobs": ["ExampleJob123ABC"]
    }
    

    2.Completing multiple jobs:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/dispatchedJobs
    REQUEST BODY:
    {
      "jobs": ["ExampleJob123ABC_1", "ExampleJob123ABC_2"]
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. Specifically, for this API, this response code can occur when there is no job code provided or when the job code provided is invalid.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances regarding the result of the API. E.g. "job completed successfully" or an error message.
    completedJobs Array of job codes for all jobs that have been dispatched by the API.

    Response Example (200 OK)

    1.Successfully dispatch one job:

    {
        "message": "Jobs completed successfully",
        "completedJobs": [
            "ExampleJob123ABC"
        ]
    }
    

    2.Successfully dispatch multiple jobs:

    {
        "message": "Jobs completed successfully",
        "completedJobs": [
            "Example123ABC_1",
            "Example123ABC_2"
        ]
    }
    
    

    Response Example (400 Bad Request)

    1.Job code(s) provided in request body doesn’t exist:

    {
    "message": "Invalid job code: ABCABC",
        "completedJobs": []
    
    }
    

    2.No job codes in request body were provided or no data provided in request body:

    {
        "message": "Missing or invalid 'jobs' field",
        "completedJobs": []
    }
    

    Create Batch

    Create a new batch using this api in the SSF portal.

    URL: https://[subdomain].smartshopfloor.cloud/api/2.0/createBatch

    Field Description
    Request
    name Name of batch
    operation Name of the operation
    componentIds Defines the array of components ids. Use getAllJobs API to find relevant componentId
    workcentreId The id of the workcentre where the batch is to be performed. Use the getAllWorkcentres API to find relevant workcentreId.
    Responses
    message Displays a message in certain instances. E.g. "Batch created successfully."
    batch Returns the batch Id which got created

    Sample Request

    POST Request
    {
        "name": "Batch 1",
        "operation": "PAINT",
        "componentIds": [
            "636b2f5478c13b0006a4169e",
            "636b2f5478c13b0006a416a3"
        ],
        "workcentreId": null
    }
    Response
    {
        "message": "Batch created successfully.",
        "batch": "63d8ac199188e46db9ac6582"
    }
    Error Response
    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation not found in this department"
    }
    

    Close Job

    Path

    POST /api/2.0/closeJob

    Description

    This API allows you to close the job or individual component. For the request to be executed, a job code, component name and operation name can be specified within the request body, and the request will use these fields to close specific operations depending on what information is provided. With this being said, the API always requires a job code where the other parameters are optional based on the level/number of operations the user wants the API to close.

    When the API is provided all of a job code, component and operation name, the API will find the operation within the component and job defined and close the operation. Similarly, when the API is provided a job code and component name only, the API will find all operations in the defined job with the same component name as the one provided and close all jobs found. Finally, when the API is only provided a job code, the API will close all operations in the job provided.

    The API also allows for a field “forceClose“ to be defined, which is a boolean field that when true will close the operation regardless of if the operation is in progress or not.

    Note: The API will change the status of the operation to “closed” if an operator has worked on that job/operation. Otherwise, if an operator has not worked on the job/operation, the job status will be changed to “cancelled”.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Field Description
    code (required) Unique job code.
    component Name of the component to be closed.
    operation Name of the operation to be closed.
    isForceClose Closes the job/component even though they are in progress (boolean value true/false).

    Request Example:

    1.Closing an operation in a job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/closeJob 
    
    REQUEST BODY:
    {
      "code": "1001",
      "component": "ARM",
      "operation": "PAINT",
      "isForceClose": true
    }
    

    2.Closing all operations in a specific component in a job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/closeJob 
    
    REQUEST BODY:
    {
      "code": "1001",
      "component": "ARM",
      "operation": "",
      "isForceClose": true
    }
    

    3.Closing whole job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/closeJob 
    REQUEST BODY:
    {
      "code": "1001",
      "component": "",
      "operation": "",
      "isForceClose": true
    }
    

    Note: Set isForceClose to true if you wish to close the job even if some operations are in progress on the job. If no work is done on the work centre, then the component status will be set to cancelled. If work is completed on work centre, then the component status is set to closed.

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. Specifically, for this API, this response code can occur when there is no job code provided or when the job code provided is invalid.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances regarding the result of the API. E.g. "Component closed successfully" or an error message.
    component The ID of the component that has been closed. (Provided when closing a component(s) of a job)
    job The ID of the job which has been closed. (Provided when closing a whole job)

    Response Example (200 OK)

    1.Closing a specific operation within a component in the job:

    {
        "message": "Component closed successfully.",
        "component": "67d8d92e35e3622540b50130"
    }
    

    2.Closing all operations within a component in the job

    {
        "message": "Component closed successfully.",
        "component": "CRANK"
    }
    

    3.Closing all operations in all components for a job:

    {
        "message": "Job closed successfully.",
        "job": "62d6807f3776485754af87ee"
    }
    

    Response Example (400 Bad Request)

    1.Job code provided doesn’t exist:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job with this code does not exist."
    }
    
    

    2.Job code isn’t provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"code\" is not allowed to be empty"
    }
    

    3.Component doesn’t exist in job or operation(s) that meet request body criteria are all already closed:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "No operations active to be closed for this component"
    }
    

    4.Operation doesn’t exist in job:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Component with this name and operation within the given job code des not exist."
    }
    
    

    5.Operation without Component provided:

    {
     "statusCode": 400,
        "error": "Bad Request",
        "message": "Component and operation both are required for closing operation."
    }
    

    Delete Job

    Path

    DELETE /api/2.0/deleteJob/[JobCode]

    Description

    The API allows you to delete a job, that is yet to start, based on the Job Code provided in the API URL. If the job has already started, meaning at least one component is in progress, then the job cannot be deleted. In this scenario, the next option is to call the Close Job API and close the job. The API requires the job code of the job to be attached in the request URL, not in the request description (see request example below).

    Note: This API is a DELETE Request.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Example:

    1.Delete job by providing job code in request URL:

        DELETE https://[SubDomain].smartshopfloor.cloud/api/2.0/deleteJob/12345678
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. For this API specifically, this response code can be caused in the following situations 1)Job code provided is invalid or doesn’t reference a job.2)Job has already started and therefore cannot be deleted.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances regarding the result of the API. E.g. "job deleted successfully" or an error message.
    job The ID of the job deleted.
    code The Code of the job deleted.

    Response Example (200 OK)

    1.Job successfully deleted:

    {
        "message": "Job deleted successfully.",
        "job": "633554c9fb0e450006c381d0",
        "code": "144794"
    }
    

    Response Example (400 Bad Request)

    1.Job has already started and cannot be deleted:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Cannot delete job as it has some work done on it, call closeJob API for this job."
    }
    

    2.Job code provided is invalid

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job not found"
    }
    
    

    Delete Component

    Path

    DELETE /api/2.0/deleteComponent/[ComponentID]

    Description

    The API allows you to delete a component/operation within the job, that is yet to start, based on the Component ID provided in the API URL. If the status of the component has already started, then the component cannot be deleted. In this scenario, only other option is to call the Close Job API and physically close the component. To do this, the API requires the SSF ID of the component/operation to be included in the request URL, not in the request body (see request example below). A component/operation ID can be found by executing the “getAllJobs” API which will retrieve all data for the job including all components/operations, including their ID.

    Note: This API is a DELETE Request.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Example:

    1.Delete specific component:

        DELETE https://[SubDomain].smartshopfloor.cloud/api/2.0/deleteComponent/633554c9fb0e450006c381d0
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. For this API specifically, this response code can be caused in the following situations1.Component Id code provided is invalid or doesn’t reference a job.2)Component provided has already started and therefore cannot be deleted.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances regarding the result of the API. E.g. "Component deleted successfully" or an error message.
    component Returns the component Id which got removed

    Response Example (200 OK)

    1.Component deleted successfully:

    {
        "message": "Component deleted successfully.",
        "component": "633554c9fb0e450006c381d0"
    }
    

    Response Example (400 Bad Request)

    1.Component has already started and cannot be deleted:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Cannot delete component as the component is in progress or completed, call postJob API to complete this component."
    }
    

    2.Job code provided is invalid or not provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Component not found"
    }
    

    Get All Operations

    Path

    GET /api/2.0/getAllOperations

    Description

    Retrieves all operations saved within the SmartShopFloor portal.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    N/A

    Request Example:

    1.Request all operations:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllOperations
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    operationId ID generated by SSF given to the operation retrieved.
    operation Name of the operation retrieved.
    tag Tag of the operation retrieved.

    Response Example (200 OK)

    1.Successfully retrieve all operations saved in SSF:

    {
        "operations": [
            {
                "operationId": "64cb29f0d67063000645df8d",
                "operation": "Customer Confirmation",
                "tag": "CUSTCONFIRM"
            },
            {
                "operationId": "64cb2a0bd67063000645e012",
                "operation": "Drawing and Design",
                "tag": "DRAWDESIGN"
            }
        ]
    }
    
    

    Get Last Closed Operations

    Path

    GET /api/2.0/getLastClosedOperations?JobCode=[JobCode]&before=[Before]&afterDate=[AfterDate]

    Description

    This API can retrieve a variation of different results, all of which will return a list of completed operations with the operations returned being dependent on the filters/parameters provided to the API.

    When the request API is provided an date as “end date”, the API will retrieve the last closed operation for all operations created after the date provided. On the other hand, when the request API is provided a job code, the API will retrieve all completed operations for the job specified. Finally, when the request API is provided time as “before“, the API will return all completed operations that occurred within the time range between the specified time (“before”) and one hour prior.

    Therefore, when the request API is provided a combination of these parameters, the API will retrieve the operations that meet all conditions defined. With this being said, at least one of the parameters must be included for the API to execute.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Job Code where the API will find all operations for this job that have been completed.
    before (required) DateTime that when defined, the API will search for all operations that has been completed between the DateTime entered and one hour prior.
  • before can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • afterDate (required) Date that when defined, the API will return all operations that became completed on and after the date.
  • afterDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • ** Note:** Either ‘jobCode', ‘before’ or 'afterDate’ is required to be included in the request for the API to execute, they do not all have to be in the request for the request to execute correctly.

    Request Example:

    1.Get last closed operation request API provided with a job code value only:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getLastClosedOperations?jobCode=Example123ABC
    

    2.Get last closed operation request API provided with a before time and after-date value:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getLastClosedOperations?before=2025-02-01T10:30:00Z&afterDate=2025-01-01
    

    3.Get last closed operation request API provided with a job code, before time and after-date value:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getLastClosedOperations?jobCode=Example123ABC&before=2025-02-01T10:30:00Z&afterDate=2025-01-01
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    operationId Id generated by SSF given to the operation retrieved.
    operation Name of the operation retrieved.
    operationStartTime Time that the operation was started for work to be performed on it. Formatted in ISO 8601 UTC DateTime.
    operationEndTime Time that the operation ended work being performed on it. Formatted in ISO 8601 UTC DateTime.

    Response Example (200 OK)

    1.At least one parameter included with all parameters being valid:

    [
        {
            "jobCode": "EXAMPLE123ABC",
            "code": "DRAFTING & DESIGN",
            "operationStartTime": "2025-03-11T03:12:12.000Z",
            "operationEndTime": "2025-03-11T05:22:35.000Z"
        },
        {
            "jobCode": "EXAMPLE123ABC",
            "code": "CUSTOMER CONFIRMATION",
            "operationStartTime": "2025-03-11T02:53:39.000Z",
            "operationEndTime": "2025-03-11T05:22:35.000Z"
        }
    ]
    
    

    Response Example (400 Bad Request)

    1.Job Code is not valid:

    {
        "statusCode": 404,
        "error": "Not Found",
        "message": "Job with jobCode 'ABCABC' not found"
    }
    
    

    2.Invalid “Before“ DateTime value:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid 'before' Parameter"
    }
    

    3.Invalid “afterDate“ Date value:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid 'afterDate' Parameter"
    }
    

    4.No parameters provided:

    
    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid Parameters: At least one of 'before', 'afterDate', or 'jobCode' is required"
    }
    

    Get Last In Progress Operation

    Path

    GET /api/2.0/getLastInprogressOperations?from=[FromDate]

    Description

    Finds all in progress and completed operations that are within a specific time range defined in the API request.

    The API has one required parameter, “from“, that is a DateTime value. When the API is provided a “from” date, it will return all operations that were completed between the date specified and one day prior as well as return all operations in progress since the “from” date.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    from (required) Date that the API will use to returns all operations that were completed within the specified date and one day prior as well as any inprogress operations that were created after the specified date.
  • from can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • Request Example:

    1.Request all in progress and specific completed operations:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getLastInprogressOperations?from=2025-01-05T00:15:00Z
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    jobCode Code for the job the operation belongs to.
    operationCode Code of the operation returned
    operationStartTime Time when the operation started work. Field is formatted in ISO 6801 UTC DateTime.

    Response Example (200 OK)

    1.Successfully retrieve operations that satisfy the API and the included parameters:

    [
        {
            "jobCode": "EXAMPLEJOB123ABC",
            "operationCode": "DRAFTING & DESIGN",
            "operationStartTime": "2025-01-05T17:12:31+08:00"
        },
        {
            "jobCode": "EXAMPLEJOB123ABC",
            "operationCode": "Cat18",
            "operationStartTime": "2025-01-05T18:01:53+08:00"
        },    {
            "jobCode": "EXAMPLEJOB123ABC",
            "operationCode": "INSPECTION",
            "operationStartTime": "2025-01-06T09:39:43+08:00"
        }
    ]
    

    Response Example (400 Bad Request)

    1.“From” Date value either invalid or not included:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid Parameters"
    }
    

    Get Predecessors

    Path

    GET /api/2.0/getPredecessors?job=[JobCode]

    Description

    Finds all predecessors defined within a job with the job code provided in the request. The API will return a list of all operations that are defined as a predecessor for other operation(s) in the job that was specified in the request and will provide the name and SSF ID of each operation returned. To execute the API, the job code for the job being queried must be included in the request URL, not in the request body (see request example below).

    Request Headers:

    Key | Value

    content-type | application/json ApiKey | API key provided for API usage.

    Request Parameters:

    Key Value
    job Defines the job code for the Job that the API use will find all predecessor for.

    Request Example:

    1.Request all predecessors for a specific job:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getPredecessors?job=EXAMPLEJOB123ABC
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    predecessors A list of all predecessors found within the job being queried by the API. The API will provide the following data for each component defined as predecessor.
    id SSF ID for the operation that is defined as a predecessor.
    name Name of the operation that is defined as a predecessor.

    Response Example (200 OK)

    1.Valid Job code provided with predecessors defined for operations in the requested job:

    {
        "predecessors": [
            {
                "id": "67cfca86c7791910019be95f",
                "name": "Drawing and Design"
            },
            {
                "id": "67cfca86c7791910019be99e",
                "name": "Assembly Setup"
            },
            {
                "id": "67cfca86c7791910019be979",
                "name": "Picking"
            },
            {
                "id": "67cfca87c7791910019be9be",
                "name": "Welding"
            },
            {
                "id": "67cfca87c7791910019be9ca",
                "name": "Blasting"
            },
            {
                "id": "67cfca87c7791910019be9da",
                "name": "Priming"
            },
            {
                "id": "67cfca88c7791910019be9fa",
                "name": "Top Coat"
            },
            {
                "id": "67cfca88c7791910019bea19",
                "name": "Fitting"
            }
        ]
    }
    

    2.Valid job code is provided where no predecessors are defined for the job’s operations:

    {
        "predecessors": []
    }
    

    Response Example (400 Bad Request)

    1.No job code is provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job Code is required"
    }
    

    2.Job code provided is invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job with code ABCABC doesn't exist"
    }
    

    Complete Operations

    Path

    POST /api/2.0/completeOperations

    Description

    When executed, the API will set the status for the requested operation(s) in a job as “completed”.

    The API will find all operations in a specific job using the job code and operation names that are included in the request body of the API. The request also requires the user to include a true/false value “completed“ for each operation requested, which will determine if the API sets the operation to complete. The API allows for multiple operations from the same job to be completed within one request, however not multiple operations in multiple different jobs.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    code (required) Job code for the operation(s) will change its status.
    operation.name (required) Name of the operation that will change its status.
    operation.completed (required) Boolean field that when true will change the status of the operation to completed

    Request Example:

    1.Request one operation within a Job to be changed to completed:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/completeOperations
    
    REQUEST BODY:
    {
        "code": "EXAMPLEJOB123ABC",
        "operation": [
            {
                "name": "Picking",
                "completed": true
            }
        ]
    }
    

    2.Request one operation within a Job to be changed to completed:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/completeOperations
    
    REQUEST BODY:
    {
        "code": "EXAMPLEJOB123ABC",
        "operation": [
            {
                "name": "Picking",
                "completed": true
            },
            {
                "name": "Packing",
                "completed": true
            }
        ]
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Returns a message with the outcome of the API request.

    Response Example (200 OK)

    1.Valid job code and operations provided and all operations successfully changed to completed:

    {
        "message": "Operations completed successfully"
    }
    

    2.Valid job code and operation(s) provided however completed field set to false:

    {
        "message": "Operation \"Picking\" was not completed as \"completed\" is false."
    }
    

    Response Example (400 Bad Request)

    1.Invalid Job Code Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job not found"
    }
    

    2.No Job Code or Operation Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "jobCode and operations are required"
    }
    

    3.Invalid operation provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation \"ABCABC\" not found"
    }
    

    4.Operation already has been completed:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation \"Picking\" has already been completed"
    }
    

    5.Completed field missing:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"completed\" is required"
    }
    

    6.Completed field given a non-boolean field:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"completed\" must be a boolean"
    }
    

    Get Inventory

    Path

    GET /api/2.0/getInventory?jobCode=[JobCode]

    Description

    Retrieves all inventory that is allocated to a job with the same job code as the code provided in the request. The API will return a list of all the inventory item’s data for the specified job only including the allocated and used quantity of the item in the job. The API required the job code to be included in the request URL, not in the request body (see request example below).

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Code for the job which the API will find all inventory items that have been assigned to this job.

    Request Example:

    1.Request all inventory data for a specific job:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getInventory?jobCode=EXAMPLEJOB123ABC
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    _id SSF ID of the inventory item allocated to the specified job.
    StockCode Stock Code of the inventory item allocated to the specified job.
    StockSize Stock Size of the inventory item allocated to the specified job.
    usedQuantity Actual quantity used of the inventory item in the specified job.
    allocatedQuantity Allocated quantity of the inventory item assigned to the specified job.
    stockDescription Description of the inventory item allocated to the specified job.
    make Make of the inventory item allocated to the specified job.

    Response Example (200 OK)

    1.Valid job code provided where the job found has inventory allocated to it:

    [
        {
            "_id": "66cd690543f3325ef6771ba9",
            "StockCode": "WO1001",
            "StockSize": "",
            "usedQuantity": 3,
            "allocatedQuantity": 3,
            "stockDescription": "Pipe Black,48.3mm OD x 3.2mm Wall",
            "make": ""
        },
        {
            "_id": "6789d1fc3b66bfe9753a4b3c",
            "StockCode": "WO1002",
            "StockSize": "",
            "usedQuantity": 1,
            "allocatedQuantity": 2,
            "stockDescription": "Pipe Black,48.3mm OD x 3.2mm Floor",
            "make": ""
        }
    ]
    

    Response Example (400 Bad Request)

    1.Valid job code provided where the job found does not have inventory allocated to it:

        "Job doesn’t have any inventory allocated"
    

    2.Invalid Job code provided:

        "Job not found"
    

    3.No job code provided:

        "Job id/code missing"
    

    Get Updates On Crt Comp Inventory

    Path

    GET /api/2.0/getUpdatesOnCrtCompInventory?datetime=[DateTime]

    Description

    Retrieves all inventory items that have been allocated/used since the date that is specified in the API request. The API will return a list of all inventory items that meet the parameters provided and provide the stock code of the inventory item that has been used, the job code responsible for using the item, the quantity used by the job and a boolean value representing if the use of the item has been deleted in SSF or not. The API requires a “datetime“ date parameter to be included in the request, where the API will use this date provided to find all instances that any item has been used by any job since this date.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    datetime (required) Date that the API will use to return job inventory data for all inventory that has been used since the date provided.
  • dateTime can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    stockCode Code of the inventory item that has been allocated to and/or used in a specific job.
    jobCode Code of the job the inventory item has been allocated to and/or used in.
    usedQuantity Quantity used in jobs since the date specified in the API request parameter.
    isDeleted Boolean field representing if the inventory item has been deleted from SSF.

    Response Example (200 OK)

    1.Valid date provided here there has been at least one inventory item used in a job since the date specified:

    [
        {
            "stockCode": "Mild Steel, Plate, 5mm",
            "jobCode": "WO1903",
            "usedQuantity": 120,
            "isDeleted": false
        },
        {
            "stockCode": "M8 X 25 S/STEEL BUTTON SOCKET SCREWS",
            "jobCode": "WO1903",
            "usedQuantity": 80,
            "isDeleted": false
        },
        {
            "stockCode": "PVC Coated Wire 2.4/3.2",
            "jobCode": "WO2335",
            "usedQuantity": 12,
            "isDeleted": false
        },
        {
            "stockCode": "SSB 4-4 S/STEEL BLIND RIVETS",
            "jobCode": "WO2335",
            "usedQuantity": 160,
            "isDeleted": false
        }
    ]
    
    

    Response Example (400 Bad Request)

    1.No date provided:

    {
        "statusCode": 400,
        "message": "No date was provided."
    }
    

    Response Example (404 Not Found)

    1.Valid date provided where no inventory items have been used by any jobs since the date specified:

    {
        "statusCode": 404,
        "message": "Inventories not found for 2025-03-01T00:00:00Z"
    }
    

    2.Invalid date provided:

    {
        "statusCode": 404,
        "message": "Inventories not found for 2025-15-15T00:00:00Z"
    }
    

    Add Inventory

    Path

    POST /api/2.0/addInventory

    Description

    The API will create and add a new inventory item into the SSF inventory database that will then be able to be allocated to and be used by SSF jobs. The API will create the inventory based on the information provided by the user in the request body.

    The request will always require a “Stock Code“ to be provided and therefore all other possible fields are optional which the user can choose to allocate a value to or keep null when the item is created. Since the “Stock Code“ field is unique and is required for the request, a user isn’t able to create a new inventory item with the same code as an existing item, where in this case the API will return all data relating to the item with the existing stock code and will not upload any data included in the API to SSF. Finally, in a similar pattern, an item also cannot have the same stock code as an item that originally had this code but has been deleted, as in this case the API will return an error.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    stockCode (required) Stock Code for the specific inventory item being created.
    make Make for the specific inventory item being created.
    model Model for the specific inventory item being created.
    stockDescription Descritpion for the specific inventory item returned.
    stockLocation Location for the specific inventory item being created.
    serialNumber Serial Number for the specific inventory item being created.
    qty Quantity available for the specific inventory item being created.
    stockGroup Stock Group for the specific inventory item being created.
    stockStatus Stock Status for the specific inventory item being created.
    stockSize Stock Size for the specific inventory item being created.

    Request Example:

    1.Create a new inventory item using the data included in the request body:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/addInventory
    
    REQUEST BODY:
    {
        "stockCode": "Example123",
        "make": "ABC",
        "model": "v0.1",
        "stockDescription": "Round Bar 8mm",
        "stockLocation": "Australia",
        "serialNumber": "1000",
        "qty": "100",
        "stockGroup": null,
        "stockStatus": null,
        "stockSize": "8mm"
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    stockCode Stock Code assigned to the inventory item created.
    stockLocation Location assigned to the inventory item created.
    make Make assigned to the inventory item created.
    model Model assigned to the inventory item created.
    stockDescription Description assigned to the inventory item created.
    qty Quantity assigned/allocated to the inventory item created.
    meta Meta Data assigned to the inventory item created.
    serialNumber Serial Number assigned to the inventory item created.
    stockGroup Group assigned to the inventory item created.
    stockStatus Status assigned to the inventory item created.
    stockSize Size assigned to the inventory item created.
    isDeleted Boolean value representing if the inventory item has been deleted or not.
    user SSF ID of the user that created the inventory item.
    _id SSF ID of the inventory item created.
    createdAt Date and Time which the inventory item was created. Field is formatted in ISO 6801 UTC DateTime.
    updatedAt Date and Time which the inventory item was last updated. Field is formatted in ISO 6801 UTC DateTime.
    __v Version of the inventory.

    Response Example (201 Created)

    1.Valid unique stock code provided with other data provided to populate a new inventory item:

    {
        "stockCode": "Example123",
        "stockLocation": "Australia",
        "make": "ABC",
        "model": "v0.1",
        "stockDescription": "Round Bar 8mm",
        "qty": 100,
        "meta": "",
        "serialNumber": "1000",
        "stockGroup": "",
        "stockStatus": "",
        "stockSize": "8mm",
        "isDeleted": false,
        "user": "5c7df49aeff39019c46fadf2",
        "_id": "67d12a1e0aaaf932a8dbc5a5",
        "createdAt": "2025-03-12T06:30:54.451Z",
        "updatedAt": "2025-03-12T06:30:54.451Z",
        "__v": 0
    }
    

    Response Example (400 Bad Request)

    1.Invalid quantity provided:

    {
        "error": "Invalid quantity provided"
    }
    

    2.Stock code is not provided in request body OR No data provided in the request body:

    {
        "error": "Stock code is missing"
    }
    

    3.Stock code provided is already assigned to an existing item:

    {
        "error": "The stock code provided is already assigned to an existing item"
    }
    

    Update Crt Inventory (PUT)

    Path

    PUT /api/2.0/crtinventory/:_id

    Description

    The API will either create a new inventory item into the SSF inventory database or update an existing inventory data within the SSF inventory database. The API will create the inventory based on the information provided by the user in the request body.

    The API requires the same request parameters in its request body as the API addInventory. When the API is provided data including a stock code which is not currently assigned to an existing inventory item in SSF, the API will perform the same as the addInventory API and create a new inventory item that will be able to be allocated to different jobs. On the other hand, when the API is provided information in the request body including a stock code which is already assigned to an existing inventory item in SSF, the API will update this inventory item with the information from the request body.

    Note: The '/:_id' in the API URL is hardcoded and the request must be executed with this in the URL (see request example below) and that the API is a PUT request.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Field Description
    stockCode (required) Stock Code assigned to the inventory item created.
    make Make assigned to the inventory item created.
    model Model assigned to the inventory item created.
    stockDescription Description assigned to the inventory item created.
    stockLocation Location assigned to the inventory item created.
    serialNumber Serial Number assigned to the inventory item created.
    qty Quantity assigned/allocated to the inventory item created.
    stockGroup Group assigned to the inventory item created.
    stockStatus Status assigned to the inventory item created.
    stockSize Size assigned to the inventory item created.

    Request Example:

    1.Create a new inventory item using the data included in the request body:

    PUT https://[SubDomain].smartshopfloor.cloud/api/2.0/crtinventory/:_id
    
    REQUEST BODY:
    {
        "stockCode": "Example123ABC",
        "make": "ABC",
        "model": "v0.1",
        "stockDescription": "Round Bar 8mm",
        "stockLocation": "Australia",
        "serialNumber": "1000",
        "qty": "100",
        "stockGroup": null,
        "stockStatus": null,
        "stockSize": "8mm"
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    stockCode Stock Code assigned to the inventory item created.
    stockLocation Location assigned to the inventory item created.
    make Make assigned to the inventory item created.
    model Model assigned to the inventory item created.
    stockDescription Description assigned to the inventory item created.
    qty Quantity assigned/allocated to the inventory item created.
    meta Meta Data assigned to the inventory item created.
    serialNumber Serial Number assigned to the inventory item created.
    stockGroup Group assigned to the inventory item created.
    stockStatus Status assigned to the inventory item created.
    stockSize Size assigned to the inventory item created.
    isDeleted Boolean value representing if the inventory item has been deleted or not.
    user SSF ID of the user that created the inventory item.
    _id SSF ID of the inventory item created.
    createdAt Date and Time which the inventory item was created. Field is formatted in ISO 6801 UTC DateTime.
    updatedAt Date and Time which the inventory item was last updated. Field is formatted in ISO 6801 UTC DateTime.
    __v Version of the inventory.

    Response Example (201 Created)

    1.Valid unique stock code provided with other data provided to populate a new inventory item:

    {
        "stockCode": "Example123ABC",
        "stockLocation": "Australia",
        "make": "ABC",
        "model": "v0.1",
        "stockDescription": "Round Bar 8mm",
        "qty": 100,
        "meta": "",
        "serialNumber": "1100",
        "stockGroup": null,
        "stockStatus": null,
        "stockSize": "8mm",
        "isDeleted": false,
        "user": "5c7df49aeff39019c46fadf2",
        "_id": "67d8ef7335e3622540b50cfc",
        "createdAt": "2025-03-18T03:58:43.933Z",
        "updatedAt": "2025-03-18T03:58:43.933Z",
        "__v": 0
    }
    

    2.Valid stock code provided that is already assigned to an existing inventory item:

    {
        "message": "Inventory updated successfully."
    }
    

    Response Example (400 Bad Request)

    1.Invalid quantity provided:

    {
        "error": "Invalid quantity provided"
    }
    

    2.Stock code is not provided in request body OR No data provided in the request body:

    {
        "error": "Stock code is missing"
    }
    

    3.No data provided in the request body:

    {
        "error": "No parameters provided"
    }
    

    Allocate Inventory To Job

    Path

    POST /api/2.0/allocateInventoryToJob

    Description

    This API will allocate specific inventory to a specific job using the Job and Stock codes defined in the request body. The API will then allocate the inventory to the job with an allocated quantity which will be provided also within the request body.

    When the user provides a stock code that is already assigned to a specific inventory item in SSF, the API will assign this item, including all of the data assigned to the item, to the job specified.

    Alternatively, if the user provides a stock code that is not assigned to a specific inventory item in SSF, the API will create a new inventory item with the stock code provided and assign this newly created SSF item to the job specified. When this case occurs, SSF will create a new inventory item with only the stock code being assigned a value and all other fields kept as null or their default values.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    stockCode (required) Code for the inventory item which the API will allocate to a specific job.
    jobCode (required) Code for the job which the API will allocate an inventory item to.
    quantity (required) Allocated quantity the API will assign to the job for the newly assigned inventory item.

    Request Example:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/allocateInventoryToJob
    
    REQUEST BODY:
    {
        "stockCode": "6-6031",
        "jobCode": "EXAMPLEJOB123ABC",
        "quantity": 5.0
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    statusCode Response code that the API has returned after executing the request.
    message The message the API has returned after executing the request.

    Response Example (200 OK)

    1.Valid stock code job code provided where stock code provided is assigned to an existing inventory item:

    {
        "statusCode": 200,
        "message": "Inventory allocated to the job successfully.",
        "data": null
    }
    

    2.Valid stock code job code provided where stock code provided is not already assigned to an existing inventory item:

    {
        "statusCode": 200,
        "message": "Inventory allocated to the job successfully.",
        "data": null
    }
    

    Response Example (400 Bad Request)

    1.Either no job code or no stock code provided:

    {
        "error": "Both stockCode and jobCode must be provided."
    }
    

    2.Either no quantity or an invalid quantity provided:

    {
        "error": "Invalid quantity. It must be a valid number."
    }
    

    3.Invalid job code provided:

    {
        "error": "Invalid job code provided."
    }
    

    Get Timesheet Details

    Path

    GET /api/2.0/getTimesheetDetails?startDate=[StartDate]&endDate=[EndDate]&approvedAfter=[ApprovedAfterDate]&empId=[EmployeeID]&username=[EmployeeUserName]

    Description

    Retrieves the timesheet details for a specific user between dates provided in the parameters of the API.

    The API allows for the user to provide a start and end date using the parameters which will return all details for any timesheets assigned to the employee requested between these dates. The API further allows the request to be provided either an employee ID (known as “empId“) or the username of an employee to retrieve the timesheets for a specific employee within the date range defined.

    Finally, the API additionally can also be provided an “approvedDate“ parameter which, when provided, will only provide timesheet data for timesheets that has also been approved after this data. Note: “approvedDate“ only is supporting systems where approvals have been configured.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    startDate (required) Date from which timelog date is to be considered.
    endDate (required) Date up to which timelog date is to be considered.
    approvedAfter Filters the data date from when to consider the data approved after. (Only for systems where approvals have been configured).
    empId Filters data based on the empId defined in the user module.
    username Fiters data based on the username.

    Request Example:

    1.*API request with start and end date, approved after date and employeeID:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getTimesheetDetails?startDate=2024-08-07&endDate=2024-08-07&approvedAfter=2025-01-01&empId=1001
    

    2.API request with start and end date, approved after date and employee username:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getTimesheetDetails?startDate=2024-08-07&endDate=2024-08-07&approvedAfter=2025-01-01&username=1001
    

    3.API request with just start and end date:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getTimesheetDetails?startDate=2024-08-07&endDate=2024-08-07
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    data List of all days that have time logs that match the parameters included in the request. The API will provide the following data for each timesheet.
    date The date of the timelog. Field is formatted in ISO 6801 UTC Date (YYYY-MM-DD).
    userCount The count of the users who logged time entries for the specific day.
    users The user object for each user's data between the date.
    users.fullName Full name of the employee whose time is log.
    users.username Username of the employee.
    users.empId ID of the employee.
    users.tag Tag of the employee.
    users.clockInTime The time when the employee started their time log for this day. Field is formatted in ISO 6801 UTC DateTime.
    users.clockOutTime The time the employee ended their time log for this day. Field is formatted in ISO 6801 UTC DateTime.
    users.duration The total duration that the employee was working this day (in seconds).
    users.durationHrs The total duration that the employee was working this day (in hours).
    users.isApproved Boolean variable representing if the time log has been approved or not.
    users.approvedAt The date and time of approval, if applicable. Field is formatted in ISO 6801 UTC DateTime.
    users.approvedBy The user who approved the time entry, if applicable.
    users.timelog A list of all timelog objects that relate to the specific employee.
    timelog.recordType Defines what type of time log record was made. This can either be a "job" or "status" record.
    timelog.from The time when the time log was started. Field is formatted in ISO 6801 UTC DateTime.
    timelog.to The time when the time log was completed. Field is formatted in ISO 6801 UTC DateTime.
    timelog.duration The duration for which the time log was recorded (in seconds).
    timelog.durationHours The duration for which the time log was recorded (in hours).
    timelog.code The job number of the job the employee was logging time for.
    timelog.meta The meta data of the job that was worked on by the employee during this time log.
    meta.customerName The name of the customer that the job being worked on during this time log is for.
    meta.custID The ID of the customer that the job being worked on during this time log is for.
    meta.orderNo The order No of the job being worked on during this time log.
    meta.description The description of the job being worked on during this time log.
    timelog.component The component on which the employee worked on during this time log.
    timelog.operation The operation on which the employee worked on during this time log.
    timelog.workcentre The workcentre object including the ID, name of the work centre being used during this time log.
    timelog.department The department object contains id and name of the department being used during this time log.
    timelog.status The uptime/downtime status name of the timelog.
    timelog.updatedAt The last date and time that the time log was updated. Field is formatted in ISO 6801 UTC DateTime.

    Response Example (200 OK)

    1.Timesheet details found that meet the parameters provided in the request:

    {
        "data": [
            {
                "date": "2025-01-01",
                "userCount": 2,
                "users": [
                    {
                        "fullName": "Stephen Matt",
                        "username": "1001",
                        "empId": "1001",
                        "tag": null,
                        "clockInTime": "2025-01-01T04:02:32.000Z",
                        "clockOutTime": "2025-01-01T13:00:00.000Z",
                        "duration": 29548,
                        "durationHours": 8.25,
                        "isApproved": true,
                        "approvedAt": "2025-01-09T11:02:36.000Z",
                        "approvedBy": "Jon Doe",
                        "timelog": []
                    },
                    {
                        "fullName": "John Don",
                        "username": "1008",
                        "empId": null,
                        "tag": null,
                        "clockInTime": "2025-01-01T03:39:30.000Z",
                        "clockOutTime": "2025-01-01T13:00:00.000Z",
                        "duration": 30919,
                        "durationHours": 8.75,
                        "isApproved": true,
                        "approvedAt": "2025-01-09T11:02:36.000Z",
                        "approvedBy": "Jon Doe",
                        "timelog": [
                            {
                                "recordType": "job",
                                "from": "2025-01-01T03:51:36Z",
                                "to": "2025-01-01T04:05:04Z",
                                "duration": 320,
                                "durationHours": 0,
                                "code": "J-161022-02",
                                "meta": {
                                    "customerName": "ABC Corp",
                                    "custID": "1-1816",
                                    "orderNo": "1-1099",
                                    "description": ""
                                },
                                "component": "ABCD1545D",
                                "operation": "BENDING",
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": null,
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "downtime",
                                "from": "2025-01-01T06:18:36Z",
                                "to": "2025-01-01T06:21:47Z",
                                "duration": 191,
                                "durationHours": 0,
                                "code": null,
                                "meta": null,
                                "component": null,
                                "operation": null,
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": "Smoke Break",
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "job",
                                "from": "2025-01T06:24:16Z",
                                "to": "2025-01T06:40:42Z",
                                "duration": 48,
                                "code": "J-031022-9",
                                "meta": {
                                    "customerName": "Demo",
                                    "custID": "1-11405",
                                    "orderNo": "154512",
                                    "description": "Job Level Description"
                                },
                                "component": "Block-3",
                                "operation": "ABECH",
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": null,
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "downtime",
                                "from": "2025-01-01T06:41:16Z",
                                "to": "2025-01-01T06:42:40Z",
                                "duration": 84,
                                "code": null,
                                "meta": null,
                                "component": null,
                                "operation": null,
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": "Lunch",
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "downtime",
                                "from": "2025-01-01T06:43:01Z",
                                "to": "2025-01-01T06:44:24Z",
                                "duration": 83,
                                "code": null,
                                "meta": null,
                                "component": null,
                                "operation": null,
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": "Short Break",
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "job",
                                "from": "2025-01-01T06:45:28Z",
                                "to": "2025-01-01T08:44:27Z",
                                "duration": 288,
                                "code": "J-300822-2",
                                "meta": {
                                    "customerName": "ABC Corp",
                                    "custID": "1-1816",
                                    "orderNo": "1-1097",
                                    "description": ""
                                },
                                "component": "ABCD1547D",
                                "operation": "BPREP",
                                "workcenter": {
                                    "_id": "62555e693735c8000ed72a99",
                                    "name": "3DM - 003 SL",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": null,
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            },
                            {
                                "recordType": "job",
                                "from": "2025-01-01T08:43:32Z",
                                "to": "2025-01-01T10:38:34Z",
                                "duration": 25,
                                "code": "J-031022-8",
                                "meta": {
                                    "customerName": "Demo",
                                    "custID": "1-11405",
                                    "orderNo": "154512",
                                    "description": "Job Level Description"
                                },
                                "component": "BLOCKROLL",
                                "operation": "BUFF",
                                "workcenter": {
                                    "_id": "62555e2c3735c8000ed72956",
                                    "name": "3DM - 001 - Giant Machines",
                                    "workcenter": "C&H Machine Assistance Group"
                                },
                                "department": {
                                    "_id": "62555dc63735c8000ed7277e",
                                    "name": "C&H Machine Assistance Group"
                                },
                                "status": null,
                                "updatedAt": "2025-01-02T07:03:45.728Z"
                            }
                        ]
                    }
                ]
            }
        ],
        "query": {
            "tag": null,
            "empId": null,
            "username": null,
            "approvedAfter": null,
            "startDate": "2025-01-01",
            "endDate": "2025-01-03"
        }
    }
    

    Response Example (400 Bad Request)

    1.No data provided in request body:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "No parameters were provided."
    }
    

    2.Username or employee ID provided without date range:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "A date range (startDate and endDate) must be provided."
    }
    

    3.No parameters provided in request:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "No parameters were provided."
    }
    

    4.Only start or end date is provided in the request:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Both startDate and endDate are required."
    }
    

    5.Date provided is in an invalid format:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Date provided is invalid"
    }
    

    6.Date range provided is invalid (Eg: End date is before start date):

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "The end date cannot be earlier than the start date."
    }
    

    7.Portal not configured to support approvals:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Approvals are not configured, contact Administrator"
    }
    
    

    Get All Jobs

    Path

    GET /api/2.0/getAllJobs?code=[JobCode]&StartDate=[StartDate]&endDate=[EndDate]

    Description

    This API will return data for all jobs between two due dates. Note that job data will be displayed irrespective of whether the work is/has been performed or not.

    The API can be executed using different combinations of parameters in the API request. When the API is provided a start ('startDate') and end ('endDate') date parameter and no job code parameter in the API request, the API will retrieve data for all jobs that have its due date within the date range.

    If the user only provides the API the start date and no end date or job code, the API will provide all jobs with its due date between the start date provided and the date the API was requested. However, if the user only provides an end date and no start date and job code, the API will return an error, and no data will be retrieved.

    When a job code (“code“) is solely provided in the API request, meaning no start or end date is provided, the API will fetch the job data for that code. Similarly, when a job code is provided alongside the start and end date range in the API request, the API will still fetch the job data for the job with the defined code regardless of if the job’s due date is within the date range provided or not.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Field Description
    startDate (required) Defines the beginning of a date range for exporting job data. *startDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
    endDate Defines the end of a date range for exporting job data. Formatted as yyyy-MM-dd. *endDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
    code (required) Defines the job code for a specific job that the user wants the data for.

    Note: Either ‘startDate’ or ‘code’ is required to be included in the request for the API to execute, they do not both have to be in the request for the request to execute correctly.

    Request Example:

    1.Get all jobs with only start and end date range:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobs?startDate=2025-01-01&endDate=2025-03-31
    

    2.Get a job with the job code provided:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobs?code=1000
    

    3.Get all jobs with start and end date range and job code:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobs?code=1000&startDate=2025-01-01&endDate=2025-03-31
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. For this API specifically, this response code can be caused in the following situations: 1)Missing job code and start and end date 2)Missing start date (when end date is provided).3)Invalid start or end date (wrong format)
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances. E.g. "no data found" when there are no records available for the specified date range
    query.code Job code provided in request for the API to fetch data for the respective job. *Note: the dates will be ignored when jobcode is set.
    query.startdate The beginning of a date range as specified in the request.
    query.enddate The end of a date range as specified in the request.
    jobs An array of jobs returned from the API that match the query parameters defined in the request. The API will provide the following data for each job.
    jobId Unique job id provided by the system
    datatype Data type of the query. E.g. job
    code Unique job code
    startedBy Name of the person who created the job
    startedDate Date on which the job was created
    dueDate Job due date
    utilisation Cumilaive utilisation (in minutes) for all departments in this job
    jobStatus Current status of the job
    meta The meta fields contains dynamic fields that are defined at the time of client creation. These fields can hold free text or numeric data like serial no, PO, sales order, customer name, description, material cost, estimate cost, etc.
    components The components array contains all the data about the components and different operations performed on them.
    components.componentId Component unique identifier
    components.operation Name of the operation performed on the component
    components.utilisation Cumulative utilisation (in minutes) of all the work centres utilised for all the components
    components.quantity The requested quanity of the components on which the work is to be performed or the number of units requried to be manufactured
    components.completedQuantity The total quantity that were manufactured, excludes the scrapped quantity. When this element is displayed within components, it shows the total quantity. When it displays within the duration, it shows the component completed during that iteration. Default will be null if not entered
    components.scrappedQuantity The total quantity of items that were scrapped. When this element is displayed within components, it shows the total quantity. When it displays within the duration, it shows the component completed during that iteration. Default will be null, when not entered.
    components.dueDate The date by which the operation is required to be completed
    components.priority Priority of the component.
    components.duration the duration array provides the data about the work performed on the operations the timings the department and their work centres were involved to accomplish the operation, workedQuantity and scrapQuantity here is the sum total of the quantities worked upon by the user in the time frame.
    duration.workStarted Time (in ISO 8601 UTC format) that the instance of work performed was started.
    duration.workEnded Time (in ISO 8601 UTC format) that the instance of work performed was ended.
    duration.workcentreId Unique id of the work centre on which the operation was performed.
    duration.workcentre the name of the work centre on which the work is performed.
    duration.departmentId Unique id of the department on which the operation was performed.
    duration.department the name of the department on which the work is performed.
    duration.userId The user name of the employee that is used to login to the system.
    duration.user The full name of the user who logged the work performed on the workcentre.
    duration.utilisation This is the actual duration for which the work was performed. It excludes all the extra time when the user was disengaged to the job like no operator hours.
    components.sequenceNo The sequence number of the component.
    components.quantityHistory the quantityHistory array provides the data about the quantity entered from the tablet app while the operation was running or when stopped by operator.
    components.status The current status of the component.

    Response Example (200 OK)

    1.Valid request where the API returns the information for the job(s) that match the parameters provided in the request:

    {
        "message": null,
        "query": {
            "code": null,
            "startDate": "2025-01-12",
            "endDate": "2025-01-15"
        },
        "jobs": [
            {
                "jobId": "63355380fb0e450006c380ac",
                "datatype": "job",
                "code": "AYRIKO04",
                "startedBy": "007J B",
                "startedDate": "2022-09-30T05:26:28.300Z",
                "dueDate": "2025-01-13",
                "utilisation": 155,
                "jobStatus": "started",
                "jobInstruction": "",
                "meta": {
                    "customerName": "Ayk Corp",
                    "custID": "",
                    "orderNo": "",
                    "description": ""
                },
                "etc": "2022-10-11T10:30:00.000Z",
                "components": [
                    {
                        "componentId": "63355380fb0e450006c380ae",
                        "name": "Camshaft",
                        "operation": "Clean",
                        "utilisation": 155,
                        "quantity": 1,
                        "completedQuantity": 1,
                        "scrappedQuantity": 0,
                        "dueDate": "2025-01-13",
                        "status": "completed",
                        "sequenceNo": 1,
                        "priority": 1,
                        "duration": [
                            {
                                "workStarted": "2025-01-09T05:26:28.000Z",
                                "workEnded": "2025-01-09T05:29:03.000Z",
                                "workcentreId": "629041316a84ae00069419be",
                                "workcentre": "CH2 Clean",
                                "departmentId": "628f3b4aec3148000a9514c9",
                                "department": "Cylinder Heads",
                                "userId": "0007",
                                "user": "007J B",
                                "utilisation": 155,
                                "completedQuantity": 1,
                                "scrappedQuantity": 0
                            }
                        ]
                    },
                    {
                        "componentId": "63355380fb0e450006c380b0",
                        "name": "Camshaft",
                        "operation": "Grind",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-13",
                        "status": "active",
                        "sequenceNo": null,
                        "priority": null,
                        "duration": []
                    },
                    {
                        "componentId": "63367d7d2d00630006f6d4ae",
                        "name": "Door",
                        "operation": "Clean",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-13",
                        "status": "active",
                        "sequenceNo": null,
                        "priority": null,
                        "duration": []
                    },
                    {
                        "componentId": "63367d7d2d00630006f6d4b0",
                        "name": "Door",
                        "operation": "Prep",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-13",
                        "status": "active",
                        "sequenceNo": null,
                        "priority": null,
                        "duration": []
                    },
                    {
                        "componentId": "63367d7d2d00630006f6d4b2",
                        "name": "Shield",
                        "operation": "Fitting",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-13",
                        "status": "active",
                        "sequenceNo": null,
                        "priority": null,
                        "duration": []
                    },
                    {
                        "componentId": "63367d7d2d00630006f6d4b4",
                        "name": "Shield",
                        "operation": "Testing",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-13",
                        "status": "active",
                        "sequenceNo": null,
                        "priority": null,
                        "duration": []
                    }
                ]
            },
            {
                "jobId": "633564571ef89b0006a4ecd4",
                "datatype": "job",
                "code": "11125",
                "dueDate": "2025-01-14",
                "utilisation": 0,
                "jobStatus": "created",
                "jobInstruction": "",
                "meta": {
                    "serialNo": "",
                    "model": "",
                    "customerName": "ABC",
                    "orderNo": "TBA",
                    "contactName": "",
                    "email": null
                },
                "etc": "2022-10-20T04:20:00.000Z",
                "components": [
                    {
                        "componentId": "633564571ef89b0006a4ecd6",
                        "name": "CONROD",
                        "operation": "WAUKATRRB",
                        "utilisation": 0,
                        "quantity": 1,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-14",
                        "status": "active",
                        "sequenceNo": 1,
                        "priority": 1,
                        "duration": []
                    },
                    {
                        "componentId": "633564571ef89b0006a4ecd8",
                        "name": "CONROD",
                        "operation": "RDR",
                        "utilisation": 0,
                        "quantity": 7.4,
                        "completedQuantity": null,
                        "scrappedQuantity": null,
                        "dueDate": "2025-01-14",
                        "status": "active",
                        "sequenceNo": 2,
                        "priority": 1,
                        "duration": []
                    }
                ]
            }
        ]
    }
    
    

    2.Valid request where there are no jobs that meet the request parameters defined or when the job code provided is invalid:

    {
        "message": null,
        "query": {
            "code": "",
            "startDate": "2025-01-01",
            "endDate": "2025-03-31"
        },
        "jobs": []
    }
    

    Response Example (400 Bad Request)

    1.Invalid date entered (Not in correct format) for either start or end date when provided as a parameter:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid startDate format - use YYYY-MM-DD or UTC ISO String format - YYYY-MM-DDTHH:mm:ssZ (eg. \"2022-01-14T06:00:00Z\") only"
    }
    
    

    2.No job code, start and end date is provided as a parameter for the API:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Date / Job missing"
    }
    

    3.Only an end date is provided as a parameter for the API:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "startDate missing"
    }
    

    Get Job Meta Data

    Path

    GET /api/2.0/getJobMeta

    Description

    Retrieves job related meta data that can be posted with the job. Users can use the “key” element from the API’s response JSON to populate the data for a postJob API request.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    N/A

    Request Example:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getJobMeta
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    label Field label that is displayed on the job creation page in SmartShopFloor.
    key Field’s key that will be used to populate the postJob API.
    type Datatype of the field.
    search Provides an understanding on whether the field can be searched or not.
    columnlist Represents whether the field has the 'Display on UI' toggle switched on or not within SSF (This can be found in the Job Configuration→ Custom Job Fields tab in SSF).

    Response Example (200 OK)

    1.API retrieves all job meta data:

    [
        {
            "label": "Customer Name",
            "key": "customerName",
            "type": "text",
            "search": true,
            "columnlist": true
        },
        {
            "label": "Order No",
            "key": "orderNo",
            "type": "text",
            "search": true,
            "columnlist": true
        },
        {
            "label": "Serial Number",
            "key": "serialNumber",
            "type": "text",
            "search": true,
            "columnlist": null
        },
        {
            "label": "Customer Branch",
            "key": "customerBranch",
            "type": "text",
            "search": true,
            "columnlist": true
        },
        {
            "label": "Customer Note",
            "key": "customerNote",
            "type": "text",
            "search": false,
            "columnlist": null
        },
        {
            "label": "Description",
            "key": "description",
            "type": "text",
            "search": true,
            "columnlist": null
        }
    ]
    
    

    Get All Job Codes

    Path

    GET /api/2.0/getAllJobCodes?code=[JobCode]&startDate=[StartDate]&endDate=[EndDate]&exactMatch=[ExactMatch]

    Description

    Retrieve Job Codes for all jobs that are due after the start date provided. Note that job data will be displayed irrespective of whether the work has been performed or not.

    The API can be utilised in two ways. A user can choose to run the API with a valid Job code ('code') that is for a Job that they want to fetch data for, and the API will retrieve the data only for the Job with this Job Code. When the API is provided a Job code, a Boolean “exactMatch” field can be included which will identify if the API will the job with the exact same job code as provided in the request (exactMatch set to true) or if the API will find all jobs that include the job code provided (exactMatch set to false)

    On the other hand, a user can run the API with a Start Date ('startDate) that will retrieve data for all jobs with their Due Date after the Start Date defined. Extending this, the user can (optionally) include an End Date ('endDate) which will make the API retrieve data for al jobs with their Due Date between the Start and End Dates defined, however if there is no End Date provided, the API will treat the End Date as the current date.

    Note: If Job Code and a Start (and End) Date(s) are provided, the API will work by retrieving data with the same Job Code as the one provided and disregard the Dates provided, meaning if the Job Code is for a Job that has a due date outside the Start (and End) Date bound provided, the API will still return the Job with the provided Code.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Field Description
    startDate (required) Defines the first date for which the API will return data for any jobs with its due after this date.
  • *startDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • endDate Defines the last date for which the API will return data for any jobs with its due before this date. If this field is left blank, then endDate will be the current date.
  • *endDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • code (required) The code of a job that the user is requesting data for.
    exactMatch Boolean field that when set to TRUE and a job code is provided in the request, the API will only check for exact matches of the job code provided. Alternatively, when set to FALSE and a Job Code is provided, the API will find any Jobs where the Job code provided is either an exact match or a substring/partial match.
  • *exactMatch is set to TRUE by default if a value is not provided in the request.
  • Note: Either ‘startDate’ or ‘code’ is required to be included in the request for the API to execute, they do not both have to be in the request for the request to execute correctly.

    Request Example:

    1.startDate and endDate provided

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobCodes?startDate=2025-01-01&&endDate=2025-01-10
    

    2.Job Code provided

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobCodes?code=432025103
    

    3.Job Code and Exact Match provided

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getAllJobCodes?code=432025103&exactMatch=true
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API. For this request specifically, this response code can be returned when there is no start date provided in the request.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    jobs An array of jobs returned from the API that match the query parameters defined in the request. The API will provide the following data for each job.
    jobId Unique job id provided by the system.
    code Code for the job that the API is requesting data for.
    startedBy Name of the worker that started the job. (If applicable)
    startedDate The Date Time that the job was started. (If applicable)
    endDate The Date Time that the job was ended. (If applicable)
    dueDate The Due Date of the job.

    Response Example (200 OK)

    1.Valid start and end date provided:

    {
        "jobs": [
            {
                "jobId": "675bbe2f59f9cff32c57492c",
                "jobCode": "N-131224-1",
                "startedBy": "COREIoT Support",
                "startedDate": "2024-12-13T07:37:31.241Z",
                "endDate": "2025-01-31T02:30:27.753Z",
                "dueDate": "2025-01-03"
            },
            {
                "jobId": "676ea342fe3b566f9a35f9ff",
                "jobCode": "T-2712-10",
                "endDate": "2025-01-31T02:29:52.543Z",
                "dueDate": "2025-01-03"
            },
            {
                "jobId": "67737f9a0e56ef90ec093c8b",
                "jobCode": "T-3112-1",
                "endDate": "2025-01-31T02:29:50.960Z",
                "dueDate": "2025-01-04"
            },
            {
                "jobId": "6773c8c90a9d7b0eaf41b78f",
                "jobCode": "T-3112-3",
                "endDate": "2025-01-31T02:29:49.359Z",
                "dueDate": "2025-01-04"
            }
        ]
    }
    
    

    2.Job code provided:

    {
        "jobs": [
            {
                "jobId": "67c7a499fbe9f5cac2479f8d",
                "jobCode": "432025103",
                "dueDate": "2025-02-10"
            }
        ]
    }
    

    3.Job code does not exist OR No jobs with due date between start and end date provided:

    {
        "jobs": []
    }
    

    Response Example (400 Bad Request)

    1.No job code, start and end date provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Date / Job missing"
    }
    

    2.Invalid date provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid startDate format - use YYYY-MM-DD or UTC ISO String format - YYYY-MM-DDTHH:mm:ssZ (eg. \"2022-01-14T06:00:00Z\") only"
    }
    

    3.End date before start date:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Dates not valid"
    }
    

    Get Open Jobs

    Path

    GET /api/2.0/getOpenJobs

    Description

    Retrieve Job Codes for all jobs that do not have a status of "Cancelled” or "Completed". For these filtered jobs, the API will retrieve the ID and Code of the Job. This API does not take any parameters and if there are no jobs that have any status excluding "Cancelled” or "Completed" within the SSF portal, the API will return an empty array.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    N/A

    Request Example:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getOpenJobs
    

    Responses:

    Response Code | Outcome 200 OK | Success. 400 Bad Request | The server could not understand your search terms for the API. 401 Unauthorised | You did not provide the correct authentication to access this API. 403 Forbidden | You do not have the correct permissions to access this API. 404 Not Found | The API information requested could not be found. 504 Gateway Timeout | The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    jobs An array of jobs returned from the API that match the query parameters defined in the request. The API will provide the following data for each job.
    jobId Unique job id provided by the system.
    code Job code found for the corresponding job.

    Response Example (200 OK)

    1.Successfully retrieve jobs:

    {
        "jobs": [
            {
                "jobId": "652a64bf9380c70007d4cf46",
                "code": "89460"
            },
            {
                "jobId": "652a64c19380c70007d4cf9b",
                "code": "89502"
            },
            {
                "jobId": "652a64c59380c70007d4d13c",
                "code": "90209"
            },
            {
                "jobId": "652a64c79380c70007d4d18c",
                "code": "90214"
            },
            {
                "jobId": "652a64c99380c70007d4d1d7",
                "code": "90216"
            }
        ]
    }
    
    

    Complete Operations

    Path

    POST /api/2.0/completeOperations

    Description

    When executed, the API will set the status for the requested operation(s) in a job as “completed”.

    The API will find all operations in a specific job using the job code and operation names that are included in the request body of the API. The request also requires the user to include a true/false value “completed“ for each operation requested, which will determine if the API sets the operation to complete. The API allows for multiple operations from the same job to be completed within one request, however not multiple operations in multiple different jobs.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    code Job code for the operation(s) will change its status.
    name Name of the operation that will change its status.
    completed Boolean field that when true will change the status of the operation to completed

    Request Example:

    1.Request one operation within a Job to be changed to completed:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/completeOperations
    REQUEST BODY:
    {
        "code": "EXAMPLEJOB123ABC",
        "operation": [
            {
                "name": "Picking",
                "completed": true
            }
        ]
    }
    

    2.Request one operation within a Job to be changed to completed:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/completeOperations
    REQUEST BODY:
    {
        "code": "EXAMPLEJOB123ABC",
        "operation": [
            {
                "name": "Picking",
                "completed": true
            },
            {
                "name": "Packing",
                "completed": true
            }
        ]
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Returns a message with the outcome of the API request.

    Response Example (200 OK)

    1.Valid job code and operations provided and all operations successfully changed to completed:

    {
        "message": "Operations completed successfully"
    }
    

    2.Valid job code and operation(s) provided however completed field set to false:

    {
        "message": "Operation \"Picking\" was not completed as \"completed\" is false."
    }
    
    

    Response Example (400 Bad Request)

    1.Invalid Job Code Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job not found"
    }
    

    2.No Job Code or Operation Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "jobCode and operations are required"
    }
    

    3.Invalid operation provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation \"ABCABC\" not found"
    }
    

    4.Operation already has been completed:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation \"Picking\" has already been completed"
    }
    

    5.Completed field missing:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"completed\" is required"
    }
    

    6.Completed field given a non-boolean field:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"completed\" must be a boolean"
    }
    

    Export Work Performed

    Path

    GET /api/2.0/getWorkPerformed?startDate=[StartDate]&endDate=[EndDate]&workcentreId=[WorkCentreID]

    Description

    The API will find all work performed for a specific Work Centre within a date range specified from the request parameters.

    The API request required the request to be given a “workcentreId” parameter to identify the work centre that will be queried and a “startDate“ to return all work performed by/on the work centre since this start date provided. The API also allows for an “endDate“ parameter to be included with the required parameters in the request to return all data for the workcentre provided that was performed between the start date and end date provided. When the request is executed, each instance of the work centre being used to perform work for a job will be returned with data including the time the work centre was used and the job and operation that the work was for.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    startDate (required) Earliest date that the API will find work performed for the Work Centre specified.
  • startDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • endDate Latest date the API will find work performed for the Work Centre specified.
  • endDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • workcentreId (required) SSF ID of the Work Centre the API will find work performed for.

    Request Example:

    1.Request work performed for a work centre with a start and end date provided:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkPerformed?startDate=2025-01-01&endDate=2025-01-10&workcentreId=64cb395ad67063000645f445
    

    2.Request work performed for a work centre with a start date only provided:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkPerformed?startDate=2025-01-01&workcentreId=64cb395ad67063000645f445
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Message returned from the API relating to the result of the request.
    query Returns the parameters included in the API request, including the workcentreId, startDate and endDate provided.
    jobs List of operations that have used the work centre specified within the date range provided to perform work required.
    jobs.fromTime Time at which the operation started using the work centre to perform work. Field is formatted in ISO 6801 UTC DateTime.
    jobs.toTime Time at which the operation finished using the work centre to perform work. Field is formatted in ISO 6801 UTC DateTime.
    jobs.duration Duration (in seconds) that the operation used the work centre to perform work.
    jobs.code Job code of the operation that used the work centre to perform work.
    jobs.component Component name of the operation that used the work centre to perform work.
    jobs.operation Operation name of the operation that used the work centre to perform work.
    workcentre Provides details regarding the Work Centre that has been included in the query to find work performed using it. Includes the SSF ID and name of the Work Centre as well as the department and category name assigned to the Work Centre.

    Response Example (200 OK)

    1.Valid job code provided with a start (and optionally an end) date provided:

    {
        "message": "",
        "query": {
            "workcentreId": "64cb395ad67063000645f445",
            "startDate": "2025-01-01",
            "endDate": "2025-01-10"
        },
        "jobs": [
            {
                "fromTime": "2025-01-08T14:12:20Z",
                "toTime": "2025-01-08T14:15:15Z",
                "duration": 124,
                "code": "T-261224-1",
                "component": "9-200100-013",
                "operation": "Drawing and Design"
            },
            {
                "fromTime": "2025-01-07T15:01:05Z",
                "toTime": "2025-01-08T06:53:28Z",
                "duration": 41,
                "code": "T-271224-1",
                "component": "9-200100-013",
                "operation": "Drawing and Design"
            }
        ],
        "workcentre": {
            "_id": "64cb395ad67063000645f445",
            "name": "Drafting and Design",
            "department": "Drafting",
            "category": "Machining"
        }
    }
    

    Response Example (400 Bad Request)

    1.Invalid work centre provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "workcentreId not valid."
    }
    

    2.No work centre provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Workcentre not found"
    }
    

    3.Start date not provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "startDate missing"
    }
    

    4.End date before start date:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Dates not valid"
    }
    

    5.Date invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid date format - use YYYY-MM-DD only"
    }
    

    Get Work Durations Since Date Time

    Path

    GET /api/2.0/getWorkDurationsSinceDateTime?jobCode=[JobCode]&startDate=[StartDate]&endDate=[EndDate]

    Description

    The API will fetch and aggregate the work durations for a specific job or component during a specific time period. The durations include the time spent on different operations with a job or component, as well as user related information such as who performed the task and how long they worked on it. The API requires either a job code or both a start and end date to be provided in the request and the API will find the job(s) that meet the parameters included and fetch the relevant information.

    The API supports the request including multiple different parameters to retrieve certain data. First, the API allows for a job code to be defined in the API request, which will therefore make the API return all work durations data for the job specified. On the other hand, the API also supports a date range being defined in the request using a start date and end date parameter, which will return all work durations data for any jobs that occurred within the date range.

    Note: if the API is provided a job code, start and end date, the API will disregard the date range provided and provide all information for the job that is assigned the job code provided in the request.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Job code assigned to the job that the API will return the relevant information for.
    startDate (required) The start date for the date range provided that the API will use to return information within the specified dates.
  • startDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • endDate (required) The end date for the date range provided that the API will use to return information within the specified dates.
  • startDate can be formatted using as a standard date (YYYY-MM-DD) or an ISO 8601 UTC Date Time (YYYY-MM-DDTHH:mm:ssZ).
  • Note: Either ‘jobCode' or both ‘startDate’ and 'endDate’ is required to be included in the request for the API to execute, they do not both have to be in the request for the request to execute correctly.

    Request Example:

    1.Valid request with job code provided only:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkDurationsSinceDateTime?jobCode=EXAMPLEJOB123ABC
    

    2.Valid request with start and end dates only provided:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/getWorkDurationsSinceDateTime?startDate=2025-01-01&endDate=2025-03-01
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    jobs An array of job objects that meet the parameter requirements of the request.
    jobs.jobId The ID of the job specified.
    jobs.code The job code for the Job specified.
    jobs.meta Metadata related d to the job. Included orderNo which is the order number associated with the job.
    jobs.components An array of component objects that belong to the job which have been worked on since the date and time defined in the request.
    components.name The name of the component within the job.
    components.operation The name of the operation related to the component
    components.sequence The sequence number of the operation or component.
    components.workStarted The start time of the work on the component. Field is formatted in ISO 6801 UTC DateTime.
    components.workEnded The end time of the work on the component. Field is formatted in ISO 6801 UTC DateTime.
    components.userId ID of the user who performed the work.
    components.quantity The total quantity for the component that has been used.
    components.completedQuantity The number of completed items for the component.
    components.duration Total duration of work done on the component (in seconds).
    components.userDurations An array of user-duration instances, where each instance represents a user’s contribution to the work with a calculated duration.
    userDurations.userId The ID of the user.
    userDurations.username The full name of the user.
    userDurations.duration The total duration the user worked on the component.

    Response Example (200 OK)

    1.Valid request parameters

    { "jobs": [ { "jobId": "67cfca62c7791910019be765", "code": "EXAMPLEJOB123ABC_1", "meta": { "orderNo": "12345" }, "components": [ { "name": "STANDARD", "operation": "Laser Cutting", "sequence": null, "workStarted": "2025-01-02T09:52:12.000Z", "workEnded": "2025-01-02T15:32:50.000Z", "userId": "66aa2957a3e704188b8f586c", "quantity": 1, "completedQuantity": null, "duration": 20438, "userDurations": [ { "userId": "6255", "username": "Lilly", "duration": 19825 }, { "userId": null, "username": "COREIoT Support", "duration": 613 } ] } ] }, { "jobId": "670f74f53ecec4194fb26eb0", "code": "EXAMPLEJOB123ABC_2", "meta": { "orderNo": "67890" }, "components": [ { "name": "STARDARD", "operation": "Drawing And Design", "sequence": null, "workStarted": "2025-01-04T11:40:38.000Z", "workEnded": "2025-01-04T16:15:38.000Z", "userId": "66aa2957a3e704188b8f586c", "quantity": 1, "completedQuantity": null, "duration": 16500, "userDurations": [ { "userId": "6255", "username": "Lilly", "duration": 6815 }, { "userId": "1220", "username": "Carolina11 Kumari", "duration": 8476 }, { "userId": null, "username": "COREIoT Support", "duration": 1209 } ] } ] } ] }

    Response Example (400 Bad Request)

    1.Job Code doesn’t exist:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job code not found"
    }
    

    2.Start date is provided and end date is not provided (Same for start date not provided and end date is provided):

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid endDate format - use YYYY-MM-DD or UTC ISO String format - YYYY-MM-DDTHH:mm:ssZ (eg. \"2022-01-14T06:00:00Z\") only"
    }
    

    3.Date range provided is invalid (EG: end date is before start date):

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Dates not valid"
    }
    

    Integration Fetch Job Stock Data

    Path

    GET /api/2.0/integrationJobStockData?name=[Name]

    Description

    Will retrieve any Integration Job Stock Data saved to SSF.

    The API requires a value to be assigned to the parameter “name” as the API will retrieve the integration job details saved to SSF using the name specified. When this happens, the API will return all data relating to the saved job, including the SSF ID of the instance of the data save, the name of the data save (which was used as a parameter), when the data save was made and details regarding the job saved.

    The most common “name” values for different types of integration data includes “last-updates”, “job-status”, “error-log” and “configuration”.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    name (required) Name of the integration job save that the API will retrieve.

    Request Example:

    1.Retrieve the integration job stock data saved in SSF with the name specified:

        GET https://[SubDomain].smartshopfloor.cloud/api/2.0/integrationJobStockData?name=last-updates
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    success Boolean variable representing if the API was able to retrieve data based on the request parameter or not.
    result Details found for the data saved in SSF with the same name as the name provided in the request.
    result._id SSF ID for the intrgataion jock stock data save retrieved.
    result.name Name that the integration job stock data save was made under.
    result.__v Version of the save.
    result.createdAt The date and time at which the save was created.
    result.data List of all job instances saved in SSF under the name provided in the API request. Each instance will include the job information that is the same as the information returned from a job returned from the getAllJobs array.
    result.isDeleted Boolean field representing if the save has been deleted or not.
    result.updatedAt The date and time that the save was last updated.

    Response Example (200 OK)

    1.Name provided in request exists in an integration job stock data save in SSF:

    {
        "success": true,
        "status": 200,
        "message": "Data retrieved successfully",
        "result": {
            "_id": "6763b219d747f061d3aeec98",
            "name": "last-updates",
            "__v": 0,
            "createdAt": "2025-01-10T05:41:44.837Z",
            "data": [
                {
                    "code": "89460",
                    "jobNo": "89460",
                    "dueDate": "2025-03-01T00:00:00",
                    "jobInstruction": null,
                    "templateCode": [
                        {
                            "code": "STOCK",
                            "qty": 2
                        }
                    ],
                    "description": "",
                    "customer": "SWARM FARM ROBOTIC AGRICULTURE",
                    "orderNo": "PO-00004078",
                    "serialNo": null,
                    "quoteNo": null,
                    "type": "",
                    "jobCategory": "",
                    "jobRef": "",
                    "buildNo": null,
                    "estimatedHours": 0,
                    "jobType": null,
                    "customerBranch": "16 Cottonview Road,Emerald QLD 4720"
                }
            ],
            "isDeleted": false,
            "updatedAt": "2025-01-20T12:36:13.296Z"
        }
    }
    

    Response Example (400 Bad Request)

    1.Name parameter not provided:

    {
        "success": false,
        "status": 400,
        "message": "Invalid query. Ensure 'name' is provided."
    }
    

    Response Example (404 Not Found)

    1.Name parameter invalid:

    {
        "success": false,
        "status": 404,
        "message": "Data not found"
    }
    

    Integration Fetch Job Stock Data

    Path

    POST /api/2.0/integrationJobStockData

    Description

    The API will save Integration Job Stock Data to SSF using the data provided in the request body of the API including providing a unique “name” value which is unique to each integration job stock data save.

    The API requires all values that will be saved to be included in the API request body, and the API will return the ID, name and creation date and time of the instance saved in SSF as well as all integration job stock data saved under this ID/name.

    Since the “name” is unique for each save, if the value for “name“ provided in the request is already assigned to a different save in SSF, the API will update that existing save with the data provided in the request instead on creating a new save.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    name (required) Name that the job details will be saved under.
    value (required) All details relating to the integration job stock data that will be saved to SSF. These fields can be seen in the request example and are the same request body fields as the API request postJob. At least one field must be provided for the request to execute.

    Request Example:

    1.Save the integration job stock data saved in SSF with the data provided:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/integrationJobStockData
    
    REQUEST BODY
    {
        "name": "Example123",
        "value": [
            {
                "code": "89460",
                "jobNo": "89460",
                "dueDate": "2025-03-01T00:00:00",
                "jobInstruction": null,
                "templateCode": [
                    {
                        "code": "TemplateCode-1",
                        "qty": 2
                    }
                ],
                "description": "",
                "customer": "SWARM FARM ROBOTIC AGRICULTURE",
                "orderNo": "PO-00004078",
                "serialNo": null,
                "quoteNo": null,
                "type": "",
                "jobCategory": "",
                "jobRef": "",
                "buildNo": null,
                "estimatedHours": 0,
                "jobType": null,
                "customerBranch": "16 Cottonview Road,Emerald QLD 4720"
            }
        ]
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    success Boolean variable representing if the API was able to retrieve data based on the request parameter or not.
    message Details found for the data saved in SSF with the same name as the name provided in the request.
    data Data details saved in SSF under the name provided in the API request.
    data._id SSF ID for the integrated job stock data save retrieved.
    data.isDeleted Boolean field representing if the save has been deleted or not.
    data.name Name that the integration job stock data save was made under.
    data.__v Version of the save.
    data.createdAt The date and time at which the save was created.
    data The details of the integration job stock that the API has been saved. Will only provide fields within Data that have been assigned a value. See GET integrationJobStockData API to see the fields that can be assigned to 'data'.
    data.updatedAt The date and time that the save was last updated.

    Response Example (200 OK)

    1.Valid data including a value for “name“ (either already existing or not) provided in the request:

    {
        "success": true,
        "status": 200,
        "message": "Data updated successfully",
        "data": {
            "_id": "67d2836de9de36094304d16b",
            "isDeleted": false,
            "name": "Example123",
            "__v": 0,
            "createdAt": "2025-03-13T07:04:13.409Z",
            "data": [
                {
                    "code": "89460",
                    "jobNo": "89460",
                    "dueDate": "2025-03-01T00:00:00",
                    "jobInstruction": null,
                    "templateCode": [
                        {
                            "code": "TemplateCode-1",
                            "qty": 2
                        }
                    ],
                    "description": "",
                    "customer": "SWARM FARM ROBOTIC AGRICULTURE",
                    "orderNo": "PO-00004078",
                    "serialNo": null,
                    "quoteNo": null,
                    "type": "",
                    "jobCategory": "",
                    "jobRef": "",
                    "buildNo": null,
                    "estimatedHours": 0,
                    "jobType": null,
                    "customerBranch": "16 Cottonview Road,Emerald QLD 4720"
                }
            ],
            "updatedAt": "2025-03-13T07:04:13.409Z"
        }
    }
    

    Response Example (400 Bad Request)

    1.Nothing provided for either fields Name or Value:

    {
        "success": false,
        "status": 400,
        "message": "Invalid payload. Ensure 'name' and 'value' (array of objects) are provided."
    }
    

    Create BoM(s)

    Path

    POST /api/2.0/createBOM

    Description

    This API will create a Bill of Materials for a specific job using the data defined in the request body of the API. The API requires a Job Code to be provided, which will be the code assigned to the job that will have a new BoM assigned to it.

    The API also requires a “checklist” to be included in the request body, which is the list of different items that the API will add to the job’s BoM, where each item instance in the list will have a Stock Code, Size, Brand, Description and Quantity provided. When these are provided and the request is sent, the API will create a new BoM for the job with the code provided if there is not an existing BoM assigned to it, otherwise the existing BoM will be updated with the information provided in the request

    Request Headers

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Code for the job that the API will be create a new or updating its existing BoM.
    checklistHeader Header information for the checklist.
    checklist (required) List of fields and assigned values that needs to be included in the BoM. At least one of the following fields needs to be defined in the checklist.
    checklist.STOCKCODE Stock Code of the item being added to the job’s BoM.
    checklist.SIZE Size of the item being added to the job’s BoM.
    checklist.BRAND Brand of the item being added to the job’s BoM.
    checklist.DESCRIPTION Description for the item being added to the job’s BoM.
    checklist.QTY Estimated quantity that the job will use for the item being added to the job’s BoM.

    Request Example:

    1.Create BoM:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createBOM
    
    REQUEST BODY: 
    [{
        "jobCode": "EXAMPLE123ABC_3",
        "checklistHeader": "EXAMPLE123ABC_3 BoM Header:",
        "checklist": [
            {
                "STOCKCODE": "6-6023",
                "SIZE": "14mm",
                "BRAND": "",
                "DESCRIPTION": "6-6023",
                "QTY": "4"
            },
            {
                "STOCKCODE": "6-6010",
                 "SIZE": "Eyenut - A",
                "BRAND": "",
                "DESCRIPTION": "6-6010",
                "QTY": "5"
            }
        ]
    }]
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    OK Boolean field representing if the API returned a 200 OK status (TRUE) or not (FALSE).
    error If an error has occurred during the API request, this field will be populated with the error message the API has thrown. This field can include multiple errors that occurred during the request execution.
    msg If an error has been thrown, this field will be populated with the message of the error thrown.

    Response Example (200 OK)

    1.Valid job code and checklist provided:

    {
        "ok": true,
        "error": []
    }
    

    2.No Job Code provided:

    {
        "ok": true,
        "error": [
            {
                "jobCode": "",
                "checklistHeader": "EXAMPLE123ABC_3 BoM Header:",
                "checklist": [
                    {
                        "STOCKCODE": "6-6023",
                        "SIZE": "14mm",
                        "BRAND": "",
                        "DESCRIPTION": "6-6023",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    },
                    {
                        "STOCKCODE": "6-6010",
                        "SIZE": "Eyenut - A",
                        "BRAND": "",
                        "DESCRIPTION": "6-6010",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    }
                ],
                "msg": "At least one of the required fields (Job Code, checklist) is missing."
            },
            {
                "jobCode": "",
                "checklistHeader": "EXAMPLE123ABC_3 BoM Header:",
                "checklist": [
                    {
                        "STOCKCODE": "6-6023",
                        "SIZE": "14mm",
                        "BRAND": "",
                        "DESCRIPTION": "6-6023",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    },
                    {
                        "STOCKCODE": "6-6010",
                        "SIZE": "Eyenut - A",
                        "BRAND": "",
                        "DESCRIPTION": "6-6010",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    }
                ],
                "msg": "Job is not configured in the SmartShopFloor portal."
            },
            {
                "jobCode": "",
                "checklistHeader": "EXAMPLE123ABC_3 BoM Header:",
                "checklist": [
                    {
                        "STOCKCODE": "6-6023",
                        "SIZE": "14mm",
                        "BRAND": "",
                        "DESCRIPTION": "6-6023",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    },
                    {
                        "STOCKCODE": "6-6010",
                        "SIZE": "Eyenut - A",
                        "BRAND": "",
                        "DESCRIPTION": "6-6010",
                        "QTY": "3",
                        "SERIAL NUMBER": [],
                        "crtDetails": {
                            "checked": false,
                            "checkedBy": null,
                            "checkedOn": null,
                            "serial": []
                        }
                    }
                ],
                "msg": "Cannot read properties of null (reading '_id')"
            }
        ]
    }
    

    3.Empty/no Checklist provided in the request:

    {
        "ok": true,
        "error": [
            {
                "jobCode": "EXAMPLE123ABC_3",
                "checklistHeader": "EXAMPLE123ABC_3 BoM Header:",
                "checklist": [],
                "msg": "At least one of the required fields (Job Code, checklist) is missing."
            }
        ]
    }
    

    4.No data provided in request body:

    {
        "ok": true,
        "error": [
            {
                "msg": "At least one of the required fields (Job Code, checklist) is missing."
            },
            {
                "msg": "Job is not configured in the SmartShopFloor portal."
            },
            {
                "msg": "Cannot read properties of undefined (reading 'forEach')"
            }
        ]
    }
    

    Update BoM

    Path

    POST /api/2.0/bomUpdate

    Description

    This API is designed for updating an existing BOM by modifying specific attributes of items in the BOM. The API allows details like quantities, serial numbers, etc., to be updated for a given part number and item number within the BOM of a job. This can be done by the API including a job code, part number and item number along with all a list of “items” that include all fields that will be updated with their new values.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Code assigned to the Job that the API will update the specified item.
    partNo (required) Part number to be updated in the BoM of the job specified.
    itemNo (required) Item number to be updated in the BoM of the job specified.
    items (required) Set of updates to apply to the item specified in the BoM of the job specified. At least one field with a value assigned must be included in the set, but the set can include only fields you choose to update if preferred.
    isCut Flag indicating if the update is related to a “Cut” process.

    Request Example:

    1.Update BoM item:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/bomUpdate
    
    REQUEST BODY: 
    {
        "jobCode": "EXAMPLE123ABC_3",
        "partNo": "6-6010",
        "itemNo": "Eyenut - A",
        "items": {
            "MATERIAL": "Updated Description",
            "LENGTH": 12,
            "UNIT WEIGHT": 3.365,
            "SERIAL NUMBER": "234",
            "REV": 1
        },
        "isCut": false
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    ok Boolean value representing if the request successfully updates a BoM (TRUE) or not (FALSE).
    closeOperations An empty array.
    error If an error has occurred during the API request, this field will be populated with the error message the API has thrown.
    message If an error has been thrown, this field will be populated with the message of the error thrown.

    Response Example (200 OK)

    1.Valid job code and checklist provided:

    {
        "ok": true,
        "closeOperations": []
    }
    

    Response Example (400 Bad Request)

    1.Job Code, Part Number or Item Number Missing:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job Code, Part Number, Item Number) is missing."
    }
    

    2.Job Code Invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job is not configured in the SmartShopFloor portal."
    }
    

    3.Part Number Or Item Number Invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "The Part Number and Item Number combination is not found in the Bill of Material"
    }
    

    Update Bom List

    Path

    POST /api/2.0/bomListUpdate

    Description

    The API handles the batch processing of multiple BOM updates for a list of jobs. It processes an array of BOMs, which can include different BOMs from different Jobs, and updates them one by one. It also collects and handles any necessary closing operations for components. Within the array of BOMs, each BOM must include its job code, part number and item number for the API to successfully identify it and include all updated fields within the ‘items’ field.

    Effectively, this API will perform the same action as bomUpdate but will be able to update multiple BOMs that exist within the same job

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    jobCode (required) Code assigned to the Job that the API will update the specified item.
    partNo (required) Part number to be updated in the BoM of the job specified.
    itemNo (required) Item number to be updated in the BoM of the job specified.
    items (required) Set of updates to apply to the item specified in the BoM of the job specified. At least one field with a value assigned must be included in the set, but the set can include only fields you choose to update if preferred.
    items.DESCRIPTION New description of the BOM item.
    items.QUANTITY New quantity of the BOM item.
    items.UNIT WEIGHT New weight of the BOM item.
    items.SERIAL NUMBER New serial number of the BOM item.
    items.REV New Rev of the BOM item.
    isCut Flag indicating if the update is related to a “Cut” process.

    Request Example:

    1.Update BoM List:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/bomListUpdate
    
    REQUEST BODY: 
    [
        {
            "jobCode": "TESTJOB200325",
            "partNo": "OK1026 - 7000",
            "itemNo": "OK1026 - 7000",
            "items": {
                "DESCRIPTION": "Updated Description",
                "QUANTITY": 6,
                "UNIT WEIGHT": 4.1,
                "SERIAL NUMBER": "123",
                "REV": 1
            },
            "isCut": false 
        },
        {
            "jobCode": "TESTJOB200325_2",
            "partNo": "OK-CY1002 - 7000",
            "itemNo": "OK-CY1002 - 7000",
            "items": {
                "DESCRIPTION": "Updated Description",
                "QUANTITY": 10,
                "UNIT WEIGHT": 12.7,
                "SERIAL NUMBER": "456",
                "REV": 2
            },
            "isCut": false 
        }
    ]
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    itemCode Item number for the BOM that the API has updated.
    partNo Part number for the BOM that the API has updated.
    reason Message from the API identifying if the API was successful or not and if not, why the API was unsuccessful.
    sendinmail Boolean variable representing if an email has been sent to the client regarding the result of the API.
    systemError Boolean variable representing an error was created/thrown during the execution of the API.

    Response Example (200 OK)

    1.Successfully update multiple BOMs (from the same or different jobs):

    [
        {
            "itemCode": "OK1026 - 7000",
            "partNo": "OK1026 - 7000",
            "reason": "success",
            "sendinmail": false,
            "systemError": false
        },
        {
            "itemCode": "OK-CY1002 - 7000",
            "partNo": "OK-CY1002 - 7000",
            "reason": "success",
            "sendinmail": false,
            "systemError": false
        }
    ]
    

    Response Example (400 Bad Request)

    1.Missing Job Code:

    {
        "statusCode": 400,
        "message": "Job Code is missing."
    }
    

    2.Invalid Job Code:

    {
        "statusCode": 400,
        "message": "Job code is invalid or does not exist."
    }
    

    3.Part and Item Number combination doesn’t exist in job:

    {
        "statusCode": 400,
        "message": "Part Number or Item Number is missing."
    }
    

    4.Part Or Item Number missing from API request body:

    {
        "statusCode": 400,
        "message": "The Part Number and Item Number combination is not found in the Bill of Materials."
    }
    

    Stage Dispatch

    Path

    POST /api/2.0/stageAndDispatch

    Description

    Use this API to stage or dispatch a component or job whose all operations are completed. A component or job cannot be dispatched without being staged. If there is a requirement to directly dispatch, call the API twice, first to stage and then to dispatch.

    The API requires a Job Code to be provided along with a Component Name if staging or dispatching operations for a specific component only, otherwise only a Job Code is required to stage or dispatch all operations within a job. The API also requires an “action“ field to be specified with either “stage” or “dispatch” to identify if the operation(s) should be staged or dispatched.

    The API will tell the return an OK message if the API was successful with its request, otherwise it will return an error message outlining why the request failed.

    Note: Only those clients who sees only jobs on their staging queue will be able to stage and dispatch at job level. The clients who see job along with component on their staging queue only perform stage and dispatch at component level. Therefore, depending on the settings configured for a particular client in production monitoring, if a client doesn’t have permissions to execute a job level request, the API will return an error message of “Action invalid for this component“.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value

    code (required) | Unique job code or identifier component | The name of the component that is to be staged. Note: This field needs to be left blank if job level stage or dispatch is performed. action (required) | Using its two valid inputs (“stage” or “dispatch”), this will identify if the component/job is to be staged or dispatched.

    Note: ‘component’ is required when executing the API to stage/dispatch a specific component of a job only.

    Request Example:

    1.Stage a component in a job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/stageAndDispatch
    
    REQUEST BODY: 
    {
      "code": "EXAMPLE123ABC_3",
      "component": "CRANK",
      "action": "stage"
    }
    
    

    2.Dispatch a full job:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/stageAndDispatch
    
    REQUEST BODY: 
    {
      "code": "EXAMPLE123ABC_3",
      "action": "dispatch"
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    ok Boolean field representing if the API was successful at staging/dispatching the identified component/job.
    error Name of the error when an error is thrown by the API.
    message Message of the error when an error is thrown by the API.

    Response Example (200 OK)

    1.API successfully staged/dispatched a component or job:

    {
        "ok": true
    }
    

    Response Example (400 Bad Request)

    1.Job Code Not Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Missing Job Code"
    }
    

    2.Job Code Invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job Not Found"
    }
    

    3.Component Invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Job components statuses invalid"
    }
    

    4.Invalid Action Provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Invalid Action"
    }
    

    5.Action Cannot Be Completed For Component:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Action invalid for this component"
    }
    

    Create Batch

    Path

    POST /api/2.0/createBatch

    Description

    This API will create a new batch for a manufacturing process or a production operation. It validates the request body to ensure the batch is created with the correct components and associated workcenter. The API ensures that the components belong to the same department, and it checks if the given operation is valid for the workcenter. Once validated, it proceeds to create the batch.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    name (required) Name of the batch.
    operation (required) Name of the operation.
    componentIds (required) An array of component ID for the components included in the new batch. At least one valid component ID must be included in the array for the API to execute.
    workcentreId (required) The ID of the workcentre where the batch is to be performed.

    Request Example:

    1.Create Batch:

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createBatch
    
    REQUEST BODY: 
    {
        "name": "Example Batch",
        "operation": "Assembly Drafting",
        "componentIds": [
            "67db7ba2fc97ddd9739d1a37",
            "67db8457fc97ddd9739d2698",
            "67db8458fc97ddd9739d26b2"
        ],
        "workcentreId": "64cb395ad67063000645f445"
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    message Displays a message in certain instances regarding the result of the API. E.g. "Batch created successfully" or an error message.
    batch The ID of the new batched that has been created in the request.

    Response Example (200 OK)

    1.Successfully create new batch:

    {
        "message": "Batch created successfully.",
        "batch": "63d8ac199188e46db9ac6582"
    }
    
    

    Response Example (400 Bad Request)

    1.One or more components included are already apart of another batch:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "CRANK already part of another batch"
    }
    

    2.No components are included in request body or the operation included is not in the same department as the components provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Operation not found in this department"
    }
    

    3.*Components included in request are not assigned to the same department *

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Please use same department components found in batch"
    }
    

    4.Work Centre invalid/not provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Work centre not found"
    }
    

    5.Component ID invalid:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"0\" with value \"ABCABC\" fails to match the required pattern: /^[0-9a-fA-F]{24}$/"
    }
    

    6.Batch name not provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "\"name\" is not allowed to be empty"
    }
    

    Create Operator

    Path

    POST /api/2.0/createOperator

    Description

    This API will create a new operator to be added to the SSF portal. The API will allow operator details to be provided in the body of the request, which the API will use to create the operator. The API will allow an operator to be assigned a first name, last name, pin, email and employee ID, however the API only requires a first name and pin to be provided where other values will be assigned to null if not provided.

    With this being said, the pin field is unique and therefore the request will not create the operator if the pin provided is already assigned to another operator. At a minimum, to create a new operator, a value must be assigned to ‘firstName’ and 'pin'.

    Request Headers:

    Key Value
    content-type application/json
    ApiKey API key provided for API usage.

    Request Parameters:

    Key Value
    Key Value
    firstName (required) First Name for the operator being created.
    lastName Last Name for the operator being created.
    pin (required) PIN for the operator being created.
    email Email of the operator being created.
    empId ID the employee will be assigned.

    Request Example:

    1.Create Operator

    POST https://[SubDomain].smartshopfloor.cloud/api/2.0/createOperator
    
    REQUEST BODY: 
    {
        "firstName": "John",
        "lastName": "Doe",
        "pin": "1234",
        "email": "JohnDoe@email.com",
        "empId": "1000"
    }
    

    Responses:

    Response Code Outcome
    200 OK Success.
    400 Bad Request The server could not understand your search terms for the API.
    401 Unauthorised You did not provide the correct authentication to access this API.
    403 Forbidden You do not have the correct permissions to access this API.
    404 Not Found The API information requested could not be found.
    504 Gateway Timeout The server, working as a gateway did not get a response in time to the API.

    Response Fields:

    Field Description
    _id ID of the newly created operator. This is provided only when the API successfully creates a new operator.
    error Name of the error thrown by the API. This is provided only when the request is unsuccessful and does not create a new operator.
    message Error message returned by the API. This is provided only when the request is unsuccessful and does not create a new operator.

    Response Example (200 OK)

    1.Operator successfully created:

    {
        "_id": "67db7d79fc97ddd9739d1f38"
    }
    

    Response Example (400 Bad Request)

    1.PIN provided has already been assigned to existing operator.

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "PIN is already taken."
    }
    

    2.First name and/or PIN not provided:

    {
        "statusCode": 400,
        "error": "Bad Request",
        "message": "Parameters missing - firstname / pin"
    }