Friday, October 7, 2011

[Rails] 403 Error Dont know whats wrong.

Hi,

I am quite new to ruby and am programming an application to send sms
using rest_client gem. I so far have code on one of my modules which
tries to send an sms to a number. It gives the 403 error -

RestClient::Forbidden in SMSController#index

403 Forbidden
Rails.root: /Users/user1/Desktop/rails_projects/sms_app

My code in the module looks as follows - before adding this code i had a
simple enter number and enter message text boxes with the usual
edit/add/delete options.

require 'rubygems'
require 'rest_client'

class SMS < ActiveRecord::Base

API_URL = 'http://services.xxxx.com/SMS'
API_KEY = '000000000'
RestClient.post 'API_URL/TXT/XXXX/07996750812/wakeup/API_KEY',
:number => '079945460812', :nested => { :message => 'working from
inside' }
RestClient.get 'https://yyy@gmail.com:password@API_URL'
end

My user name is in the form of an email. let me what you think the
problem would be. thanks :)

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate