/workorders v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Work Orders
getWorkOrders
Code samples
const headers = {
Accept: "application/json",
Authorization: {
type: "string",
},
};
fetch("https://goldleaf.app/api/v1/workorders", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /workorders
Retrieve all work orders with optional filtering and pagination
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string | true | Bearer token for authorization |
| search.number | query | string | false | Search by work order number (partial or full match) |
| search.description | query | string | false | Search by description text |
| search.status | query | string | false | Search by status text |
| number | query | string | false | Filter by exact work order number |
| status | query | array[string] | false | Filter by one or more statuses |
| customerOrgId | query | string | false | Filter by customer organization ID (MongoDB ObjectId) |
| hoseAssemblyId | query | string | false | Filter by hose assembly ID (MongoDB ObjectId) |
| hoseKitId | query | string | false | Filter by hose kit ID (MongoDB ObjectId) |
| workOrderId | query | string | false | Filter by work order ID (MongoDB ObjectId) |
| salesEstimateId | query | string | false | Filter by sales estimate ID (MongoDB ObjectId) |
| onlyCustomer | query | boolean | false | If true, only include customer-related work orders |
| page | query | integer | false | Page number for pagination (provided by paginationValidators) |
| limit | query | integer | false | Number of items per page (provided by paginationValidators) |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | List of work orders matching filter criteria | None |
| 500 | Internal Server Error | none | string |
