get https://api.gomotive.com/v1/messages
Purpose: Use this API to fetch a list of all the messages you’ve sent to your drivers. You must specify your user ID to fetch these messages. Refer to the headers section for more info.
NOTE
You may also use the optional query parameters for narrowing down the scope of the API response. This will allow you to fetch specific messages within a specified timeline.
When you use the query parameters, your endpoint may look like this:
https://api.gomotive.com/v1/messages?min_updated_at={timestamp}&max_updated_at={timestamp}&per_page={messages_per_page}&page_no={page_number}OR
require 'uri'
require 'net/http'
url = URI('https://api.gomotive.com/v1/messages')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
response = http.request(request)
puts response.read_body
Response Parameters
message
- Type: Object
- Description: Contains the object that details the message.
updated_at
- Type: String (ISO 8601 datetime)
- Description: The timestamp when the message was last updated.
id
- Type: String
- Description: The unique identifier for the message, including its protocol and ID.
sender_id
- Type: Number
- Description: The unique identifier of the user who sent the message.
recipient_id
- Type: Number
- Description: The unique identifier of the user who received the message.
body
- Type: String
- Description: The content or text of the message.
attachment
- Type: Object
- Description: Contains the attachment details if present.
location
- Type: Object
- Description: Contains the location details associated with the message, if any.
status
- Type: String
- Description: The current status of the message (e.g., "read").