Endpoints

Version

Return the current version of the API.

Endpoint

GET /version

Sample response

{
  "version": "1.0.0"
}

Plans

Plans are collections of services (i.e. work to be done) and routes. They are used for running different scenarios (e.g. truck, driver, and zone combinations) for a particular service date.

Endpoint

/plans

List plans

Return the organization's plans.

GET /plans

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "plans": [
    {
      "planId": "9e0e59c956f34b54ac21ad4f900d3418",
      "orgName": "Next Day Dumpsters",
      "dispatched": false,
      "services": 128.0,
      "status": "Incomplete",
      "created": "2019-08-26T21:26:07.713878Z",
      "routes": 14.0,
      "createdBy": "user@nextdaydumpsters.com",
      "name": "Daily Plan 2019-08-27",
      "totalTime": 136.77,
      "orgId": "d7yft4",
      "serviceDate": "2019-08-27",
      "totalDistance": 2376.3,
      "modified": "2019-08-28T18:01:43.351407Z"
    }
  ]
}

Create a plan

POST /plans

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

NameTypeExample Value
serviceDatestring2019-09-04
namestringDaily Plan 2019-09-04

Sample response

{
  "planId": "f075719a06d94da7a791c0347623aa9c",
  "orgName": "Next Day Dumpsters",
  "dispatched": false,
  "services": 0.0,
  "status": "Incomplete",
  "created": "2019-09-14T17:48:38.070524Z",
  "routes": 0.0,
  "createdBy": "user@nextdaydumpsters.com",
  "name": "Daily Plan 2019-09-14",
  "totalTime": 0.0,
  "orgId": "d7yft4",
  "serviceDate": "2019-09-14",
  "totalDistance": 0.0,
  "modified": "2019-09-14T17:48:38.070524Z"
}

List plan services

Return the services for a specific plan.

Endpoint

GET /plans/{planId}/services

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "planId": "9e0e59c526f34b54ac21ad4f900d3418",
  "services": [
    {
      "activity": "DELIVERY",
      "planId": "9e0e59c556f34b54dj21ad4f900d3418",
      "size": "20.00 YD",
      "zip": "20832",
      "logid": 193661.0,
      "dumpster_type": "LD",
      "extra_time": 0.0,
      "time": "8:00AM-12:00PM",
      "zone": 1.0,
      "address": "123 MAIN ST",
      "order": 194415.0,
      "name": "DOE, JOHN",
      "city": "Olney, MD",
      "service": "20 YD DUMPSTER - C&D DEBRIS",
      "date": "08/27/2019",
      "objectId": 1.0,
      "routeInfo": {
        "serviceSide": 2.0,
        "cumulativeTime": 5.493347837516922,
        "existingSequence": 0.0,
        "deltaTime": "01:25:28",
        "deltaDistance": 26.5113801213447,
        "serviceTime": 480.0,
        "demand": [20.0],
        "prepTime": 0.0,
        "recordID": 1.0,
        "cumulativeDistance": 86.31085881195031,
        "sequence": 50.0,
        "autoConnect": false,
        "route": 107.0,
        "serviceMode": "D",
        "arrivalTime": "11:26:36",
        "tripNum": 1.0,
        "waitTime": "00:00:00"
      },
      "X": -77.046747,
      "notes": "8-12 DWAY",
      "size_int": 20.0,
      "Y": 39.141018,
      "account": "40623.1.2",
      "serviceId": "1",
      "material": "C&D DEBRIS"
    }
  ]
}

Create plan services

Add services to a plan.

Endpoint

POST /plans/{planId}/services

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

An array of services with the following properties.

NameTypeExample Value
serviceIdnumber1
servicestring20 YD DUMPSTER - C&D DEBRIS
activitystringDELIVERY
materialstringC&D DEBRIS
sizestring20.00 YD
timestring8:00AM-12:00PM
notesstringAdditional comments
datestringDELIVERY
accountstring10613.1.2
logidstring893261
ordernumber194415
namestringJohn Doe
addressstring123 Main St
citystringOlney, MD
zipstring20832
Xnumber-77.046747
Ynumber39.141018

Sample response

{
  "planId": "9e0e59c526f34b54ac21ad4f900d3418",
  "services": [
    ...
  ]
}

Dispatch activities

The dispatch endpoint contains information about scheduled and historical activities for a specific date.

Endpoint

/dispatch/activities

List activities

Return activities scheduled for a specific date.

GET /dispatch/activities

Parameters

NameTypeExample ValueRequired
orgIdstringd7yft4
datestring2019-06-23
routeNamestring102
workOrderIdstring150425

If workOrderID is provided, it will return all of the activities matching that work order regardless of the date.

Try using the shorthand representations yesterday, today, and tomorrow instead of an absolute date.

Sample response

Returned activities conform to the activity data model.

An error will be returned if the date is not properly formatted. For more information, see Error Messages.

{
  "date": "2019-06-23",
  "totalActivities": 126,
  "activities": [
    {
      "acivityId": "c5859f901ca24ac08cc5a9292f8e0fc2",
      "date": "2019-06-23",
      "activityType": "delivery",
      "serviceId": "39915.1.1",
      "customerId": "193661",
      "customerName": "Jane Smith",
      "material": "c-and-d-debris",
      "activityNotes": "",
      "container": [
        {
          "containerId": "30123",
          "type": "rolloff",
          "size": 30,
          "activity": "delivery"
        }
      ],
      "vehicleType": "rolloff",
      "vehicleSize": "large",
      "latitude": 39.1564,
      "longitude": -77.1625,
      "address": "18201 Flower Hill Way",
      "city": "Gaithersburg",
      "state": "MD",
      "postalCode": "20879",
      "routeId": "2",
      "routeSequence": 5,
      "zone": "1",
      "driverId": "504320f348d647aa81108fcaaa2af2a5",
      "timeWindowStart": "2019-06-23T10:00:00Z",
      "timeWindowEnd": "2019-06-23T14:00:00Z",
      "extraTime": 10,
      "plannedStart": "2019-06-23T12:42:00Z",
      "plannedEnd": "2019-06-23T13:30:00Z",
      "plannedDuration": 38,
      "actualStart": "2019-06-23T13:02:00Z",
      "actualEnd": "2019-06-23T13:55:00Z",
      "actualDuration": 53,
      "status": "completed",
      "updateLatitude": 39.156398,
      "updateLongitude": -77.162463,
      "driverComments": "",
      "siteContact": {
        "name": "George Doe",
        "phone": "240-867-5309",
        "email": "george.doe@adress.com"
      },
      "hauler": {
        "haulerId": "1e84ea7884224598a3e6a15fa3b852e2",
        "name": "Joe's Hauling and Recycling"
      }
    }
  ]
}

Create an activity

Add a new activity to dispatch. To add multiple activities in a single request, see Creating Multiple Activities.

Endpoint

POST /dispatch/activities/

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

A JSON object with the properties defined in the Activity Data Model must be submitted with the POST. The Data must include the marked required fields.

Sample response

{
  "activityId": "287a880338af488b938fd10b0f78d52f",
  "date": "2019-06-23",
  "serviceId": "ABC123",
  "customerId": "193661",
  "customerName": "Jane Smith",
  "activity": "delivery",
  "material": "C&D Debris",
  "serviceNotes": "",
  "containerType": "rolloff",
  "containerSize": 30,
  "vehicleType": "rolloff",
  "vehicleSize": null,
  "latitude": 39.1564,
  "longitude": -77.1625,
  "address": "18201 Flower Hill Way",
  "city": "Gaithersburg",
  "state": "MD",
  "postalCode": "20879",
  "timeWindowStart": "2019-06-23T10:00:00Z",
  "timeWindowEnd": "2019-06-23T14:00:00Z",
  "extraTime": 10,
  "status": "scheduled"
}

An error will be returned if not all the required fields are not provided or if the data type of a field doesn't match the data supplied. For more information, see Error Messages.

Update an activity

Update the properties of an existing activity.

Endpoint

PATCH /dispatch/activities/{activityId}

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

An object containing the activity data model to update. Providing only the values that change is acceptable.

The date cannot be updated on an existing activity. To reschedule an existing activity, use the reschedule activity endpoint.

Sample response

{
  "orgId": "d7yft4",
  "date": "2019-06-23",
  "serviceId": "ABC123",
  "customerId": "193661",
  "customerName": "Jane Smith",
  "activity": "delivery",
  "material": "C&D Debris",
  "acitivityNotes": "",
  "containerId": "30123",
  "containerType": "rolloff",
  "containerSize": 30,
  "containers": [
    {
      "plannedId": null,
      "containerId": null,
      "type": "rolloff",
      "size": 30,
      "activity": "delivery"
    }
  ],
  "vehicleType": "rolloff",
  "vehicleSize": "large",
  "latitude": 39.1564,
  "longitude": -77.1625,
  "address": "18201 Flower Hill Way",
  "city": "Gaithersburg",
  "state": "MD",
  "postalCode": "20879",
  "routeId": "104",
  "routeSequence": 5,
  "zone": "1",
  "driverId": "123",
  "timeWindowStart": "2019-06-23T10:00:00Z",
  "timeWindowEnd": "2019-06-23T14:00:00Z",
  "extraTime": 10,
  "plannedStart": "2019-06-23T12:42:00Z",
  "plannedEnd": "2019-06-23T13:30:00Z",
  "plannedDuration": 38,
  "actualStart": "2019-06-23T13:02:00Z",
  "actualEnd": "2019-06-23T13:55:00Z",
  "actualDuration": 53,
  "status": "completed",
  "updateLatitude": 39.156398,
  "updateLongitude": -77.162463,
  "driverComments": ""
}

Delete an activity

Delete an existing activity.

Endpoint

DELETE /dispatch/activities/{activityId}

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "success": true,
  "message": "deleted activity 25aa41ge4b0746198e84d3ec7a60b0e9"
}

Creating multiple activities

Add multiple activities to dispatch with one request.

Endpoint

POST /dispatch/activities

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

An array of objects with the same properties used when creating an individual activity.

Sample response

{
  "activities": [
    ...
  ]
}

An error will be returned if not all the required fields are not provided or if the data type of a field doesn't match the data supplied. Every record will be checked for missing or invalid fields. For more information, see Error Messages.

Reschedule activity

Sets the existing Activity to rescheduled and creates a new Activity with the new date

Endpoint

POST /dispatch/activities/{activityId}/reschedule

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

This endpoint requires a date in format "YYYY-MM-DD" to be entered. This will be the day of the Activity.

NameTypeExample Value
datestring2020-01-02

Sample response

{
  "success": true,
  "activityId": "5383e0f67a1e49e0b156abd5c12ab5e3",
  "message": "Rescheduled ec2efface2e545d7ae6a9fa65b5e3f30 to 2020-01-02"
}

Create attachment

Add a photo to an activity. A small thumbnail will be generated.

Endpoint

POST /dispatch/activities/{activityId}/attachments/

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

A JSON object with properties defined in the Attachment data model must be submitted with the POST request.

The object must include the required properties and two additional fields: isBase64Encoded and payload.

Set isBase64Encoded to true if the attachment is included in the object. payload should contain an image file that has been converted to a Base64 encoded binary string.

The maximum size for an image file to be attached is 5 MB.

{
  "latitude": 39.088581,
  "longitude": -77.115318,
  "description": "Blocked dumpster",
  "filename": "image20405.jpg",
  "isBase64Encoded": true,
  "payload": "/9j/4AAQSkZ... a really big long string here ...+hOY/9k="
}

Sample response

{
  "success": true,
  "attachmentId": "5d36bf6c54404665b05e3cec4de83768",
  "origFile": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab5... ...&Expires=1604118808",
  "smallThumbnail": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab5... ...&Expires=1604118808"
}

Get attachments

Return all of the attachments for a specific activity. The response can be limited to just the thumbnail by passing thumbnail=true as a parameter.

Endpoint

GET /dispatch/activities/{activityId}/attachments/

Parameters

NameTypeExample ValueRequired
orgIdstringd7yft4
thumbnailbooleantrue

If thumbnail is true, then only signed links to the thumbnails for all of the attachments will be returned. If thumbnail is false, then the entire attachment will be returned with signed links to the thumbnail and original image.

Sample response

The originalFile and smallThumbnail fields contain signed links that are valid for 24 hours.

{
    "totalAttachments": 8,
    "attachments": [
        {
            "createdAt": "2020-10-03T02:10:22.961640Z",
            "filename": "47DF4B7B-1467-4063-A309-1E1C33879DBE.jpg",
            "createdBy": "Rolloff360 API Dev",
            "originalFile": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab5... ...&Expires=1604177454",
            "latitude": 39.088581,
            "smallThumbnail": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab5... ...&Expires=1604177454",
            "description": "Blocked dumpster",
            "attachmentId": "7b16c5d2bb4041ac94260c977ae1607b",
            "longitude": -77.115318
        },
        {
          ...
        }
    ]
}

Get attachment by ID

Return the attachment with the specified ID from the specified dispatch activity. The response can be limited to just the thumbnail by passing thumbnail=true as a parameter.

Endpoint

GET /dispatch/activities/{activityId}/attachments/{attachmentId}

Parameters

NameTypeExample ValueRequired
orgIdstringd7yft4
thumbnailbooleantrue

If thumbnail is set to true, then a status code of 307 is returned with a signed link in the body in a location field. If thumbnail is set to false, then the entire attachment will be returned with signed links to the thumbnail and original image.

Sample response

The location, originalFile and smallThumbnail fields contain signed links that are valid for 24 hours.

If thumbnail=true, a successful run will return status code of 307 is returned and the following object:

{
  "location": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab519... ...&Expires=1604177712"
}

If thumbnail=false, a successful run will return a status code 200 and the following object:

{
  "totalAttachments": 1,
  "attachments": [
    {
      "createdAt": "2020-10-03T02:57:47.742043Z",
      "filename": "47DF4B7B-1467-4063-A309-1E1C33879DBE.jpg",
      "createdBy": "Rolloff360 API Dev",
      "originalFile": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab519... ...&Expires=1604179546",
      "latitude": 39.107693,
      "smallThumbnail": "https://rolloff360-attachments-dev.s3.amazonaws.com/cd27ab519... ...&Expires=1604179546",
      "description": "Blocked dumpster",
      "attachmentId": "138aa9f7a06c4047a65018b84bb5b132",
      "longitude": -77.121088
    }
  ]
}

See Error Messages for more information on Error Message formatting.

Delete attachment

Delete an existing attachment.

Endpoint

DELETE /dispatch/activities/{activityId}/attachments/{attachmentId}

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "success": true,
  "message": "Deleted attachment 4b85a71331994732b9dda85a37420607"
}

Dispatch routes

The dispatch endpoint contains information about scheduled and historical routes.

Endpoint

/dispatch/route

List routes

Return routes planned for a specific date.

Endpoint

GET /dispatch/routes

Parameters

NameTypeExample ValueRequired
orgIdstringd7yft4
datestring2019-06-23
routeNamestring102

Try using the shorthand representations yesterday, today, and tomorrow instead of an absolute date.

Sample response

Returned routes conform to the Route data model.

{
  "date": "2020-03-03",
  "totalRoutes": 1,
  "routes": [
    {
      "routeId": "2349448fe30643049a487c3e42689485",
      "date": "2020-03-03",
      "name": "102",
      "vehicleType": "rolloff",
      "vehicleSize": "large",
      "vehicleId": "102",
      "driverId": "5ba0124092574fb9ad69724cc987f5c0",
      "hauler": {
        "name": "Next Day Dumpsters",
        "haulerId": "d7yft4"
      },
      "startLocation": {
        "name": "Beltsville Lot",
        "latitude": "39.044863",
        "longitude": "-76.899608"
      },
      "endLocation": {
        "name": "Beltsville Lot",
        "latitude": "39.044863",
        "longitude": "-76.899608"
      },
      "plannedActivities": 3,
      "completedActivities": 0,
      "plannedStart": "2020-03-03T06:00:00.000-05:00",
      "plannedEnd": "2020-03-03T08:07:00.000-05:00",
      "plannedDuration": 127,
      "actualStart": null,
      "actualEnd": null,
      "actualDuration": null,
      "plannedDistance": 42.79,
      "actualDistance": null,
      "status": "assigned",
      "zone": "2",
      "createdAt": "2020-04-06T01:26:18.901808Z",
      "lastUpdated": null
    }
  ]
}

An error will be returned if the date is not properly formatted. For more information, see Error Messages.

Get route by ID

Returns the route for the specified ID. If no route is found matching the ID, then a blank list will be returned.

Endpoint

GET /dispatch/routes/{routeId}

Parameters

NameTypeExample ValueRequired
orgIdstringd7yft4

Sample response

Returned routes conform to the Route data model

[
  {
    "routeId": "2349448fe30643049a487c3e42689485",
    "date": "2020-03-03",
    "name": "102",
    "vehicleType": "rolloff",
    "vehicleSize": "large",
    "vehicleId": "102",
    "driverId": "5ba0124092574fb9ad69724cc987f5c0",
    "hauler": {
      "name": "Next Day Dumpsters",
      "haulerId": "d7yft4"
    },
    "startLocation": {
      "name": "Beltsville Lot",
      "latitude": "39.044863",
      "longitude": "-76.899608"
    },
    "endLocation": {
      "name": "Beltsville Lot",
      "latitude": "39.044863",
      "longitude": "-76.899608"
    },
    "plannedActivities": 3,
    "completedActivities": 0,
    "plannedStart": "2020-03-03T06:00:00.000-05:00",
    "plannedEnd": "2020-03-03T08:07:00.000-05:00",
    "plannedDuration": 127,
    "actualStart": null,
    "actualEnd": null,
    "actualDuration": null,
    "plannedDistance": 42.79,
    "actualDistance": null,
    "status": "assigned",
    "zone": "2",
    "createdAt": "2020-04-06T01:26:18.901808Z",
    "lastUpdated": null
  }
]

An error will be returned if the date is not properly formatted. For more information, see Error Messages.

Create route

Add a new route to dispatch. Multiple routes can be added with Create Multiple Routes.

Endpoint

POST /dispatch/route/

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

A JSON object with the properties defined in the Activity data model must be submitted with the request including all required fields.

Sample response

{
  "routeId": "1cc5f4716fd34d8ab475c92acd8deee3",
  "date": "2020-05-25",
  "name": "106",
  "vehicleType": "rolloff",
  "vehicleSize": "large",
  "vehicleId": "114",
  "driverId": "2d6c009d88d54d5d822585e51b8cbec8",
  "hauler": null,
  "startLocation": {
    "name": "Hyattsville Lot",
    "latitude": "38.9475",
    "longitude": "-76.9411"
  },
  "endLocation": {
    "name": "Hyattsville Lot",
    "latitude": "38.9475",
    "longitude": "-76.9411"
  },
  "plannedActivities": null,
  "completedActivities": null,
  "plannedStart": "2020-05-20T06:00:00.000-04:00",
  "plannedEnd": "2020-05-20T07:42:00.000-04:00",
  "plannedDuration": "101.39999999999999",
  "actualStart": null,
  "actualEnd": null,
  "actualDuration": null,
  "plannedDistance": 42.79,
  "actualDistance": null,
  "status": "scheduled",
  "zone": "1",
  "createdAt": "2020-05-25T20:06:41.330393Z",
  "lastUpdated": null
}

An error will be returned if not all the required fields are not provided or if the data type of a field doesn't match the data supplied. For more information, see Error Messages.

Update route

Update the properties of an existing route.

Endpoint

PATCH /dispatch/route/{routeId}

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

An object containing the Route data model to update. Only providing the values that change is acceptable.

The date cannot be updated on an existing route. To reschedule an existing route, set the status to rescheduled and create a new route with the rescheduled date.

Sample response

{
  "routeId": "7cd6a71331994732b9dda85a37420607",
  "date": "2020-05-25",
  "name": "106",
  "vehicleType": "rolloff",
  "vehicleSize": "small",
  "vehicleId": "114",
  "driverId": "2d6c009d88d54d5d822585e51b8cbec8",
  "hauler": {
    "name": "Little Joe's Hauling",
    "haulerId": "56ae9ffa9f3b47e88a0ac3b3190f4e5f"
  },
  "startLocation": {
    "name": "Hyattsville Lot",
    "latitude": "38.9475",
    "longitude": "-76.9411"
  },
  "endLocation": {
    "name": "Hyattsville Lot",
    "latitude": "38.9475",
    "longitude": "-76.9411"
  },
  "plannedActivities": null,
  "completedActivities": null,
  "plannedStart": "2020-05-20T06:00:00.000-04:00",
  "plannedEnd": "2020-05-20T07:42:00.000-04:00",
  "plannedDuration": "101.39999999999999",
  "actualStart": null,
  "actualEnd": null,
  "actualDuration": null,
  "plannedDistance": 42.79,
  "actualDistance": null,
  "status": "scheduled",
  "zone": "1",
  "createdAt": "2020-05-25T20:34:46.771007Z",
  "lastUpdated": null
}

Delete route

Delete an existing route.

Endpoint

DELETE /dispatch/route/{routeId}

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "success": true,
  "message": "deleted activity 7cd6a71331994732b9dda85a37420607"
}

Create multiple routes

Add multiple routes to dispatch with one request.

Endpoint

POST /dispatch/routes

Parameters

NameTypeExample Value
orgIdstringd7yft4

Data

An array of objects with the same properties used when creating an individual route.

Sample response

{
  "routes": [
    {
      "routeId": "63fa2cce61994c74b50f06f6ee87d7b6",
      "date": "2020-05-25",
      "name": "110",
      "rest_of_data": "..."
    },
    {
      "routeId": "a5cb3183fdb643688078e8b1a2932141",
      "date": "2020-05-25",
      "name": "112",
      "rest_of_data": "..."
    }
  ]
}

An error will be returned if not all the required fields are not provided or if the data type of a field doesn't match the data supplied. Every record will be checked for missing or invalid fields. For more information, see Error Messages.

Reports

Driver route sheet

Create a PDF of a driver's route and stops and return a pre-signed URL for downloading.

Endpoint

GET /dispatch/routes/{routeId}/report

Parameters

NameTypeExample ValuesOptional
orgIdstringd7yft4
overwritestringtrue

Pass the overwrite flag with the request to force the report to be regenerated.

Sample response

{
  "message": "Completed pdf generation.",
  "pdf_link": "d7yft4/2020-05-11/104_EvanCaldwell_20200618-222423.pdf",
  "expiresIn": 3600
}

expiresIn is the number of seconds that the URL is valid for.

Drivers

Drivers are personnel available for operating the organization's vehicles.

Endpoint

/drivers

List drivers

Return the organization's drivers.

GET /drivers

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "drivers": [
    {
      "driverId": "452908f26c7441c38bb90a6670722ddb",
      "name": "Jane Smith",
      "phone": "301-555-5555",
      "status": "active",
      "samsara_id": 126463
    }
  ]
}

Vehicles

The organization's trucks and other vehicle types.

Endpoint

/vehicles

List vehicles

Return the organization's vehicles.

GET /vehicles

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

{
  "vehicles": [
    {
      "vehicleId": "33ae4fab87e745dc818986239660f03c",
      "name": "101",
      "size": "large",
      "status": "active",
      "samsara_id": 6128149381133390,
      "settings": {
        "driver": "Jane Smith",
        "start_lot": "Beltsville Lot",
        "end_lot": "Beltsville Lot",
        "start_time": "06:00",
        "end_time": "16:30",
        "max_time": 10,
        "preference": 2
      }
    }
  ]
}

Haulers

Haulers are subcontractors that may be assigned to work on specific activities. Haulers are unique to an organization.

List haulers

Returns all of the haulers for the specified organization.

Endpoint

GET /org/{orgid}/haulers

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample response

[
  {
    "haulerId": "2ffd451a47444dd79d9bf77a501073ff",
    "name": "Joe's Hauling"
  },
  {
    "haulerId": "000cf0277bfb41b195db8a3ed1ed8d91",
    "name": "Acme Hauling"
  }
]

List hauler

Return information for a specific hauler.

Endpoint

GET /org/{orgid}/haulers/{haulerId}

Parameters

NameTypeExample ValueDescription
orgIdstringd7yft4The hauler's parent org.
haulerIdstring000cf0277bfb41b195db8a3ed1ed8d91The hauler id that you want to retrieve hauler information on

Sample response

{
  "haulerId": "000cf0277bfb41b195db8a3ed1ed8d91",
  "name": "Acme Hauling"
}

Create hauler

Create a hauler in an organization. A name for the hauler is required.

Endpoint

POST /org/{orgid}/haulers

Path parameters

NameTypeExample ValueDescription
orgIdstringd7yft4The hauler's parent org.

Body parameters

NameTypeExample ValueDescription
namestringAcme HaulingThe name of the Hauling company.

Sample response

The response object will contain a key "haulers" which contains all of the org's haulers.

{
  "success": true,
  "message": "Created hauler 000cf0277bfb41b195db8a3ed1ed8d91",
  "haulers": [
    {
      "haulerId": "2ffd451a47444dd79d9bf77a501073ff",
      "name": "Joe's Hauling"
    },
    {
      "haulerId": "000cf0277bfb41b195db8a3ed1ed8d91",
      "name": "Acme Hauling"
    }
  ]
}

Update hauler

Allows for the editing of the name of a hauler.

Endpoint

PATCH /org/{orgid}/haulers/{haulerId}

Path parameters

NameTypeExample ValueDescription
orgIdstringd7yft4The hauler's parent org.
haulerIdstring000cf0277bfb41b195db8a3ed1ed8d91The hauler id of the hauler that will be modified.

Body parameters

NameTypeExample ValueDescription
namestringAcme RecyclingThe new name of the Hauling company.

Sample response

The response object will contain a key "haulers" which contains all of the org's haulers.

{
  "success": true,
  "message": "Updated Hauler 000cf0277bfb41b195db8a3ed1ed8d91",
  "haulers": [
    {
      "haulerId": "2ffd451a47444dd79d9bf77a501073ff",
      "name": "Joe's Hauling"
    },
    {
      "haulerId": "000cf0277bfb41b195db8a3ed1ed8d91",
      "name": "Acme Recycling"
    }
  ]
}

Delete hauler

Delete a specific hauler from an organization.

Endpoint

DEL /org/{orgid}/haulers/{haulerId}

Parameters

NameTypeExample ValueDescription
orgIdstringd7yft4The hauler's parent org.
haulerIdstring000cf0277bfb41b195db8a3ed1ed8d91The hauler id of the hauler that will be modified.

Sample response

The response object will contain a key "haulers" which contains all of the org's haulers.

{
  "success": true,
  "message": "Deleted Hauler 000cf0277bfb41b195db8a3ed1ed8d91",
  "haulers": [
    {
      "haulerId": "2ffd451a47444dd79d9bf77a501073ff",
      "name": "Joe's Hauling"
    }
  ]
}

Facilities

Facilities are physical locations that may be used for dumping materials, housing container inventory, and fleet start and end locations.

Endpoint

/facilities

List facilities

Return the organization's facilities.

GET /facilities

Parameters

NameTypeExample Value
orgIdstringd7yft4

Sample Response

{
  "facilities": [
    {
      "facilityId": "c6a3fbd73030445981d3881c0d631312",
      "address": "1030 Edison Highway",
      "name": "Baltimore Recycling Center",
      "city": "Baltimore",
      "state": "MD",
      "zip": "21213",
      "latitude": 39.3035,
      "longitude": -76.5751,
      "status": "active",
      "materials": ["c-and-d-debris", "general-debris"],
      "startEnd": false,
      "penalty": 2.02,
      "duration": 0.25,
      "intermediate": true,
      "containers": false
    }
  ]
}