Update an existing asset

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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
  • Availability Details

To add an external ID to the asset, take the following steps:

  1. Add the following request to the request body:
{
  "number":"toyota_32",
  # other attributes for a asset
  ...
  ...
  ...
  # add external id for asset
  "external_ids_attributes":[
    {    
    "id": "9876",    
    "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

asset

  • Type: Object
  • Description: Denotes the object that contains the details of the asset that we are creating.

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.

availability_details

  • Type: Object
  • Description: Contains the availability details object. This object denotes the availability of the asset for a dispatch.

availability_status

  • Type: String
  • Description: Denotes the availability status of the asset. Allowed values are “out_of_service” or “in_service”.

out_of_service_reason

  • Type: String
  • Description: Denotes the reason for the asset being out of service.

updated_at

  • Type: DateTime
  • Description: Denotes the date and time when the availability status of the asset was updated.

additional_note

  • Type: String
  • Description: Denotes any comments or notes added for updating the availability of the asset. For example, “This asset is scheduled for maintenance.”

custom_driver_app_warning_prompt

  • Type: String
  • Description: This denotes the prompt message that drivers see on their driver_app. This prompt can be used to inform the driver about the status of the asset or communicate any specific instructions. For example, “Asset is under maintenance, do not operate.”

updated_by_user

  • Type: Object
  • Description: Object containing the details of the user who updated the availability status of the asset.

id

  • Type: Int
  • Description: The ID of the user who updated the availability status of the asset.

first_name

  • Type: String
  • Description: First name of the user who updated the status of the asset.

last_name

  • Type: String
  • Description: Last name of the user who updated the status of the asset.

user_name

  • Type: String
  • Description: Company username of the person who updated the status.

email

  • Type: String
  • Description: Email address of the user.

company_reference_id

  • Type: Int
  • Description: The company ID of the user as per the internal company records.

status

  • Type: String
  • Description: The status of the user who updated the availability of the asset.

role

  • Type: String
  • Description: The role of the user who updated the availability status of the asset.

Path Params
int32
required

Enter the ID of the asset for which you want to update the data.

Body Params
external_ids_attributes
array of objects

Specify the external ID as well as the integration name.

external_ids_attributes
string

Specify the status of the asset. Allowed values are Active or Deactivated.

groups_ids
object
boolean

Specify if the assets are leased or not. TRUE: The asset is leased. FALSE: The asset is not leased.

int32

Specify the ID of the asset gateway to which the asset is linked to.

string

Specify the VIN number of the asset.

availability_details
object
Headers
string

Specify the timezone for formatting the timestamps.

boolean

Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units

int32

Specify the ID of the Fleet Admin or the Fleet Manager who is accessing this endpoint.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json