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.

  # other attributes for an inspection report
  # add external id for inspection report
Click Try It! to start a request and see the response here!