I’m trying to receive data from the Nexmo SMS API which can be found here:
I have a MessagesController which contains the method:
def external_message
@message.text = params[:message]
@message.recipient = params[:to]
@message.api_message_id = params[:messageId]
end
Am I going about this in the right way? I know that I will also need to amend the routes.rb file but I’m still not sure where to start there either.
Really, really appreciate any help/guidance.
Yes, this looks correct.
It looks like from the Nexmo documentation you define your own callback URL with them (this is fairly common). So if you define your callback url to be
http://mysite/nexmo_api, your route would be:get "nexmo_api" => "messages#external_message"