/inspection_reports/:id

Update an existing inspection report

require 'uri'
require 'net/http'

url = URI('https://api.keeptruckin.com/v1/inspection_reports/1')

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

request = Net::HTTP::Put.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'

params = {
  :status => 'corrected'
}

request.body = params.to_json

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

Add External Ids

To add external ids to an inspection report record just add the following to the request body. External ID represents a unique identifier for an inspection report in an external system. The name of this external system is stored as integration_name. The combination of external_id and integration_name will always be unique.

{
  "status":"corrected",
  # other attributes for an inspection report
  ...
  ...
  ...
  # add external id for inspection report
  "external_ids_attributes":[
    {
      "external_id":"987",
      "integration_name":"generic_tms"
    }
  ]
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!