Roadsync workorders API

The Workorders API

OpenAPI Specification

roadsync-workorders-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  contact:
    email: christo.delange@roadsync.com
  description: This API allows the Roadsync clients to manage aspects of the RoadSync service via an API.
  license:
    name: Copyright (c) 2020, RoadSync Inc.
  title: Client API v1.8 authenticated workorders API
  version: 1.8.45
  x-api-id: 3ea39084-d8df-11ea-ad77-0017b600647f
  x-audience: external-partner
servers:
- url: https://client-api.staging.roadsync.com/{basePath}
  variables:
    Product:
      default: ClientApi
    basePath:
      default: v1
security:
- api_key: []
- session_token: []
tags:
- name: workorders
  description: The Workorders API
paths:
  /{id}:
    get:
      tags:
      - workorders
      summary: Get Workorder by ID
      description: Retrieve the information of the workorder with the matching workorder ID.
      operationId: get-workorder-workorderId
      parameters:
      - name: id
        in: path
        description: The ID number of the object being returned
        required: true
        schema:
          type: string
          example: 2378'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workorder'
      security:
      - ApiKeyAuth: []
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
    delete:
      tags:
      - workorders
      summary: Delete workorders by ID
      description: Deletes the workorder with a specific ID.
      operationId: delete-workorders-id
      parameters:
      - name: id
        in: path
        description: The ID number of the object being returned
        required: true
        schema:
          type: string
          example: '2378'
      responses:
        '200':
          description: OK
        '403':
          description: Forbidden
        '404':
          description: Not Found
      security:
      - ApiKeyAuth: []
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${DeleteWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
  /:
    get:
      tags:
      - workorders
      summary: Get All Recent Workorders
      description: Retrieve 20 Most Recent Workorders.
      operationId: get-workorders
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workorder'
      security:
      - ApiKeyAuth: []
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetAllWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
    post:
      tags:
      - workorders
      summary: Create New Workorder
      description: Create a new workorder.
      operationId: post-workorder
      requestBody:
        description: Post the necessary fields for the API to create a new workorder.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/workorder'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                allOf:
                - {}
                - {}
        '400':
          description: Bad Request
        '409':
          description: Conflict
      security:
      - ApiKeyAuth: []
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${CreateWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
  /{id}/send:
    parameters:
    - schema:
        type: string
      name: id
      in: path
      required: true
    post:
      tags:
      - workorders
      summary: Send workorder
      operationId: post-id-send
      responses:
        '200':
          description: OK
      x-stoplight:
        id: y05euchkiofvx
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${SendWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
      description: Send a workorder to a recipient via email or text.
      requestBody:
        $ref: '#/components/requestBodies/workorderSend'
      security:
      - ApiKeyAuth: []
  /{id}/approve:
    parameters:
    - schema:
        type: string
      name: id
      in: path
      required: true
    post:
      tags:
      - workorders
      summary: Approve Workorders
      operationId: post-id-approve
      responses:
        '200':
          description: OK
      x-stoplight:
        id: vw9kug26e1gm9
      description: ''
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ApproveWorkordersFunction.Arn}/invocations
        httpMethod: POST
        type: aws_proxy
      requestBody:
        $ref: '#/components/requestBodies/workorderApprove'
      security:
      - ApiKeyAuth: []
components:
  schemas:
    companyId:
      type: string
      title: companyId
      description: Hashed company ID attached to each workorder
      example: rZNz3VwGoJDMEaok3aQY7dqWRAL4y8
    id:
      type: string
      title: id
      description: The id number of the object being returned.
      example: 6XLeG3x91pQlBWjnXvARYO2onNVM0q
    signedCarrierName:
      type: string
      title: signedCarrierName
      description: Name of carrier who signed workorder
      example: Jimbo
    reference:
      type: string
      title: reference
      description: Workorder reference for record keeping purposes
      example: Trucker LLC
    comdataApiLocationId:
      type: string
      title: comdataApiLocationId
      description: Location's unique Roadsync API ID from comdata
      example: RS301
    workOrderSettingsId:
      type: string
      title: workOrderSettingsId
      description: Hashed ID for the workorder settings
      example: O8MqwQ1X3L5RyaxVLBnNK2lGxerYAz
    userId:
      type: string
      title: userId
      description: ID of the user creating workorders
      example: AVeGYqb0d7MJpaDZxB69rlxDOZ8Nmo
    signedContactEmail:
      type: string
      title: signedContactEmail
      description: Email of the contact signing the workorder
      example: jimbo@gmail.com
    signedDriverPhone:
      type: string
      title: signedDriverPhone
      description: Phone number of driver who signed the workorder
      example: '4045194104'
    signedContactPhone:
      type: string
      title: signedContactPhone
      description: Phone number of the contact signing the workorder
      example: '4045194104'
    invoiceId:
      type: string
      title: invoiceId
      description: Hashed invoice ID for the workorder
      example: rZNz3VwGoJDMEaok3aQY7dqWRAL4y8
    invoiceStatus:
      type: string
      title: invoiceStatus
      description: Status of invoice attached to workorder
      example: completed
    signedCustomFields:
      title: signedCustomFields
      x-stoplight:
        id: cvlo0mxljty0f
      type: string
      description: Signed custom fields for workorders
    state:
      type: string
      title: state
      description: A valid 2 character state code in the United States.
      example: GA
    isLocked:
      type: boolean
      title: isLocked
      description: Boolean representation of if the location is locked
    location:
      type: object
      description: Location for the workorder
      properties:
        id:
          $ref: '#/components/schemas/locationId'
        companyId:
          $ref: '#/components/schemas/companyId'
        name:
          $ref: '#/components/schemas/locationName'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        timezone:
          $ref: '#/components/schemas/timezone'
        customFields:
          type: array
          items:
            type: object
        isLocked:
          $ref: '#/components/schemas/isLocked'
        lockedAt:
          $ref: '#/components/schemas/lockedAt'
        comdataApiLocationId:
          $ref: '#/components/schemas/comdataApiLocationId'
      x-examples:
        Example 1:
          id: 7VkjKzEOPNZnrveEXv8A4L9Y52b16G
          companyId: rZNz3VwGoJDMEaok3aQY7dqWRAL4y8
          name: Robertstown
          city: New Jack City
          state: AL
          timezone: US/Eastern
          customFields: []
          isLocked: false
          comdataApiLocationId: RS301
    updatedAt:
      type: string
      title: updatedAt
      description: Updated at value for workorder
      format: date-time
      example: '2023-11-14T16:27:56.419546Z'
    email:
      title: email
      x-stoplight:
        id: vxsl7ligmau5r
      type: string
      example: user@example.com
    locationId:
      type: string
      title: locationId
      description: Hashed ID value for the location
      example: 7VkjKzEOPNZnrveEXv8A4L9Y52b16G
    timezone:
      type: string
      title: timezone
      description: Timezone for the location
      example: US/Eastern
    signedFileId:
      title: signedFileId
      x-stoplight:
        id: zc55hhfccdzqq
      type: string
    workorder:
      type: object
      title: workorder
      properties:
        id:
          $ref: '#/components/schemas/id'
        publicId:
          $ref: '#/components/schemas/publicId'
        workOrderSettingsId:
          $ref: '#/components/schemas/workOrderSettingsId'
        reference:
          $ref: '#/components/schemas/reference'
        status:
          $ref: '#/components/schemas/status'
        companyId:
          $ref: '#/components/schemas/companyId'
        userId:
          $ref: '#/components/schemas/userId'
        signedCarrierName:
          $ref: '#/components/schemas/signedCarrierName'
        signedContactName:
          $ref: '#/components/schemas/signedContactName'
        signedDriverName:
          $ref: '#/components/schemas/signedDriverName'
        signedDriverEmail:
          $ref: '#/components/schemas/signedDriverEmail'
        signedDriverPhone:
          $ref: '#/components/schemas/signedDriverPhone'
        signedContactEmail:
          $ref: '#/components/schemas/signedContactEmail'
        signedContactPhone:
          $ref: '#/components/schemas/signedContactPhone'
        signedCustomFields:
          type: object
          properties:
            dropdown:
              type: string
            email:
              type: string
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
        invoiceId:
          $ref: '#/components/schemas/invoiceId'
        invoiceStatus:
          $ref: '#/components/schemas/invoiceStatus'
        location:
          $ref: '#/components/schemas/location'
      description: ''
    lockedAt:
      type: string
      title: lockedAt
      description: Time the location was locked
      format: date-time
      example: '2023-11-14T16:28:20.085115Z'
    signedContactName:
      type: string
      title: signedContactName
      description: Name of the contact signing the workorder
      example: Jimbo
    city:
      type: string
      title: city
      description: A valid city in the United States.
      example: Atlanta
    phone:
      title: phone
      x-stoplight:
        id: fnlotiw3umas3
      type: string
      example: 555-555-5555
      pattern: ^\d{3}-\d{3}-\d{4}$
    signedDriverEmail:
      type: string
      title: signedDriverEmail
      description: Email of driver who signed the workorder
      example: jimbo@gmail.com
    status:
      enum:
      - unknown
      - new
      - sent
      - completed
      description: Enum containing the possible workorder status
      example: sent
    publicId:
      type: integer
      title: publicId
      description: The Roadsync Public ID of the workorder
      example: 2381
    createdAt:
      type: string
      title: createdAt
      description: Created at value for workorder
      format: date-time
      example: '2023-11-14T16:27:56.419546Z'
    signedDriverName:
      type: string
      title: signedDriverName
      description: Name of driver who signed the workorder
      example: Jimbo
    locationName:
      type: string
      title: locationName
      description: Name of the location
      example: Robertstown
  requestBodies:
    workorderSend:
      content:
        application/json:
          schema:
            anyOf:
            - $ref: '#/components/schemas/email'
            - $ref: '#/components/schemas/phone'
      description: ''
    workorderApprove:
      content:
        application/json:
          schema:
            type: object
            properties:
              signedCarrierName:
                $ref: '#/components/schemas/signedCarrierName'
              signedContactPhone:
                $ref: '#/components/schemas/signedContactPhone'
              signedCustomFields:
                $ref: '#/components/schemas/signedCustomFields'
              signedDriverName:
                $ref: '#/components/schemas/signedDriverName'
              signedDriverPhone:
                $ref: '#/components/schemas/signedDriverPhone'
              signedFileId:
                $ref: '#/components/schemas/signedFileId'
  securitySchemes:
    api_key:
      in: header
      name: x-api-key
      type: apiKey
      x-apikeyInfoFunc: client_api_server.controllers.authorization_controller.check_api_key
    session_token:
      bearerFormat: JWT
      scheme: bearer
      type: http
      x-apikeyInfoFunc: client_api_server.controllers.authorization_controller.check_session_token