List all the messages for user (using a date range)

Purpose: Use this API to fetch a list of all the messages sent by a user. Note that you can use the query parameters to narrow down the messages that you want to fetch for the sender. Refer to the Query Parameters section for more info.

require 'uri'
require 'net/http'
require 'json'

url = URI('https://api.gomotive.com/v2/messages')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type']  = 'application/json'
params = {
  :sender_id 		=> 1645,
  :receiver_ids => [1591],
}
request.body = params.to_json

response = http.request(request)
puts response.read_body

Response Parameters

message

  • Type: Object
  • Description: Contains the details of a message.

sent_at

  • Type: String
  • Description: The timestamp when the message was sent.

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.

receiver_ids

  • Type: Array of Numbers
  • Description: A list of unique identifiers for the users who received the message.

body

  • Type: String
  • Description: The content or text of the message.

attachment

  • Type: Object | Null
  • Description: Contains the attachment details if present, otherwise null.

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").

Query Params
date

Specify the date after which the messages were sent by the user. NOTE: The date range must be between the start of the last week and end of current day (today) and in UTC.

date

Specify a date range before which the messages were sent by the user. NOTE: The date range must be between the start of the last week and end of current day (today) and in UTC.

int32
required

Specify the ID of the user who sent the messages.

receiver_ids[]
array of int32s

Optionally, you can also narrow down the search results by adding the receiver's IDs.

receiver_ids[]
int32
Defaults to 25

The number of records to be displayed per page.

int32
Defaults to 1

The current page number.

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

Responses

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