put https://api.gomotive.com/v1/assets/
Purpose: Use this API to update the information of an asset. Motive allows you to update the following information for an asset:
- External ID attributes
- Status
- Group IDs
- Lease information
- Corresponding Gateway ID
- VIN
To add an external ID to the asset, take the following steps:
- Add the following request to the request body:
{
"number":"toyota_32",
# other attributes for a asset
...
...
...
# add external id for asset
"external_ids_attributes":[
{
"external_id":"987",
"integration_name":"generic_tms"
}
]
}
require 'uri'
require 'net/http'
require 'json'
url = URI('https://api.gomotive.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
NOTE
The name of the external ID is stored as
integration_name
. Ensure that every time you add an external ID, you must also mention the integration name as they are used together and their values are unique.
Response Parameters
id
- Type: Number
- Description: The unique identifier assigned to the asset.
name
- Type: String
- Description: The name of the asset.
status
- Type: String
- Description: The status of the asset (e.g., "active").
type
- Type: String
- Description: The type of the asset (e.g., "flatbed").
custom_type
- Type: String
- Description: The custom type of the asset, if any.
vin
- Type: String
- Description: The Vehicle Identification Number (VIN) of the asset.
license_plate_state
- Type: String
- Description: The state of the asset's license plate.
license_plate_number
- Type: String
- Description: The license plate number of the asset.
make
- Type: String
- Description: The manufacturer of the asset.
model
- Type: String
- Description: The model of the asset.
year
- Type: String
- Description: The year the asset was manufactured.
axle
- Type: String
- Description: The axle information of the asset, if any.
weight_metric_units
- Type: Boolean
- Description: Indicates if the asset's weight is measured in metric units.
length_metric_units
- Type: Boolean
- Description: Indicates if the asset's length is measured in metric units.
leased
- Type: Boolean
- Description: Indicates if the asset is leased.
notes
- Type: String
- Description: Additional notes about the asset.
group_ids
- Type: Array
- Description: A list of all the group IDs assigned to the asset.
length
- Type: String
- Description: The length of the asset.
gvwr
- Type: String
- Description: Gross Vehicle Weight Rating of the asset.
gawr
- Type: String
- Description: Gross Axle Weight Rating of the asset.
asset_gateway
- Type: String
- Description: Information about the asset gateway, if any.
external_ids
- Type: Array
- Description: A list of external identifiers associated with the asset.
integration_name
- Type: String
- Description: The name of the integration with which the external ID is associated.