> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.megamation.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.megamation.com/_mcp/server.

# Get Work Orders

GET https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder

An example of getting work order information using search criteria.

Reference: https://apidocs.megamation.com/api/work-order/get-work-order-get-work-orders

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `STATUS` (string, optional)
- `TYPE` (string, optional)

## Response

### 200

OK

## Examples

**Response**

```json
{
  "_embedded": {
    "WorkOrder": [
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21308"
          }
        },
        "building_id": "001-0100",
        "date": "2020-02-03",
        "equipment": [
          {
            "eqp_no": "P1"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21308",
        "work_request_description": "Pump PM - Annual �** Closing comments from last work order **�Completed checklist - No issues\r\n"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21309"
          }
        },
        "building_id": "MCAMPUS",
        "date": "2020-02-03",
        "equipment": [
          {
            "eqp_no": "4609002"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21309",
        "work_request_description": "Weekly Inspection Cardboard Baler�** Closing comments from last work order **�Completed checklist - No issues"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21310"
          }
        },
        "building_id": "MCAMPUS",
        "date": "2020-02-03",
        "equipment": [
          {
            "eqp_no": "3108002"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21310",
        "work_request_description": "Monthly Boiler Inspection Using Checklist�** Closing comments from last work order **�Delayed on vacation - Completed checklists - No issues"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21311"
          }
        },
        "building_id": "BL-CORE",
        "date": "2020-02-03",
        "equipment": [
          {
            "eqp_no": "BL-CORE-AC-01"
          },
          {
            "eqp_no": "001-0100-RS01"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21311",
        "work_request_description": "Air Conditioner  Monthly Inspection�** Closing comments from last work order **�Completed checklists - No issues"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21319"
          }
        },
        "building_id": "BL-CORE",
        "date": "2020-02-03",
        "equipment": [
          {
            "eqp_no": "BL-CORE-AC-01"
          },
          {
            "eqp_no": "001-0100-RS01"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21319",
        "work_request_description": "Air Conditioner  Monthly Inspection"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21320"
          }
        },
        "building_id": "001-0100",
        "date": "2020-09-29",
        "equipment": [
          {
            "eqp_no": "P1"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21320",
        "work_request_description": "Pump PM - Monthly��"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21321"
          }
        },
        "building_id": "001-0100",
        "date": "2020-09-29",
        "equipment": [
          {
            "eqp_no": "P1"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21321",
        "work_request_description": "Pump PM - Monthly��"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21326"
          }
        },
        "building_id": "001-0100",
        "date": "2020-09-29",
        "equipment": [
          {
            "eqp_no": "P1"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21326",
        "work_request_description": "Pump PM - Monthly��"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/workorder/21327"
          }
        },
        "building_id": "001-0100",
        "date": "2020-09-29",
        "equipment": [
          {
            "eqp_no": "P2"
          }
        ],
        "status": "S",
        "submitted_by": "PM SCHEDULER",
        "type": "PM",
        "wo_no": "21327",
        "work_request_description": "Pump PM - Monthly���** Closing comments from last work order **�Completed checklists - No issues"
      }
    ]
  },
  "_links": {
    "apiEntryPoint": {
      "href": "https://api.megamation.com/mpcdev/dl"
    },
    "self": {
      "href": "https://api.megamation.com/mpcdev/dl/workorder?STATUS=S&TYPE=PM"
    }
  },
  "cursor": "",
  "has_more": "False",
  "next_page": ""
}
```

**SDK Code**

```python
import requests

url = "https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder"

querystring = {"STATUS":"S","TYPE":"PM"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megamation.com/CLIENT_ID/DATABASE_ID/workorder?STATUS=S&TYPE=PM")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```