{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.1",
    "title": "Send Driver Comments",
    "termsOfService": "https://www.truckertools.com/terms/",
    "contact": {
      "email": "integrations@truckertools.com"
    },
    "license": {
      "name": "Private",
      "url": "https://www.truckertools.com"
    },
    "description": "Requests are authenticated by the `partnerId` and `accountId` attributes in the body.\nThese values will be provided by TruckerTools during onboarding, the latter already being encrypted.\n"
  },
  "security": [],
  "paths": {
    "/loadtrackservice/sendCommentsToDriver": {
      "post": {
        "summary": "Send driver comments",
        "operationId": "sendCommentsToDriver",
        "responses": {
          "200": {
            "$ref": "#/components/responses/CommentResponse"
          },
          "400": {
            "$ref": "#/components/responses/FailedCommentResponse"
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/CommentRequest"
        }
      }
    }
  },
  "servers": [
    {
      "description": "Production Server",
      "url": "https://loadtracking.truckertools.com"
    }
  ],
  "components": {
    "schemas": {
      "Comment": {
        "type": "object",
        "required": [
          "partnerId",
          "accountId",
          "loadTrackExternalId",
          "comment"
        ],
        "properties": {
          "partnerId": {
            "type": "integer",
            "minimum": 0,
            "example": 12345,
            "format": "int64",
            "description": "This is a unique integer id that is assigned to the Partner system to identify the Partner system by the Load Track system. This has to be sent on each webservice call.\n"
          },
          "accountId": {
            "type": "string",
            "example": "E++p1waC69ktJerPRkJHQg==",
            "description": "Unique identifier of the Agent in the Broker System that entered the Load Track. This accountId has to be encrypted with the shared secret of the partner. This shared secret will be shared during the integration process.\n"
          },
          "loadTrackExternalId": {
            "type": "string",
            "example": 54321,
            "description": "The unique identifier of the Load in the Partner system.\n"
          },
          "comment": {
            "type": "string",
            "example": "Please start your track.",
            "description": "Comment to be sent to the driver.\n"
          }
        }
      }
    },
    "responses": {
      "CommentResponse": {
        "description": "Comment Response\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status",
                "timeStamp"
              ],
              "properties": {
                "response": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Success indicator.\n"
                    },
                    "message": {
                      "type": "string",
                      "description": "Status message.\n",
                      "example": "Load comment posted successfully."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "FailedCommentResponse": {
        "description": "Failed Comment Response\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status",
                "timeStamp"
              ],
              "properties": {
                "response": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Success indicator.\n",
                      "example": false
                    },
                    "errorMessage": {
                      "type": "string",
                      "description": "Status message.\n",
                      "example": "No details found."
                    },
                    "errorCode": {
                      "type": "number",
                      "description": "Error code.\n",
                      "example": 200
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "CommentRequest": {
        "description": "Load Track object that needs to be added to the load track system.\n",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Comment"
            }
          }
        }
      }
    }
  }
}