put https://api.keeptruckin.com/v1/assets/
Update an existing asset
Add External Ids
To add one or more external ids follow the same format as mentioned in POST /v1/vehicles
endpoint documentation.
require 'uri'
require 'net/http'
require 'json'
url = URI('https://api.keeptruckin.com/v1/assets/4')
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 = {
external_id_attributes: [{external_id: 456, integration_name: 'tmw_tmt'}]
}
request.body = params.to_json
response = http.request(request)
puts response.read_body