Class: Api::V1::Google::LeadsController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- Api::V1::Google::LeadsController
- Defined in:
- app/controllers/api/v1/google/leads_controller.rb
Constant Summary collapse
- GOOGLE_KEY =
"9tCy6tiTm@o_toHqDcrY"
Instance Method Summary collapse
-
#create ⇒ Object
https://api.warmlyyours.dev/en-US/v1/google/leads curl -X POST https://api.warmlyyours.me:3000/en-US/v1/google/leads/rc:C4QL28 \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "param1=value1¶m2=value2&google_key=9tCy6tiTm@o_toHqDcrY".
- #show ⇒ Object
Instance Method Details
#create ⇒ Object
https://api.warmlyyours.dev/en-US/v1/google/leads
curl -X POST https://api.warmlyyours.me:3000/en-US/v1/google/leads/rc:C4QL28
-H "Content-Type: application/x-www-form-urlencoded"
-d "param1=value1¶m2=value2&google_key=9tCy6tiTm@o_toHqDcrY"
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/api/v1/google/leads_controller.rb', line 15 def create res = Customer::GoogleLeadProcessor.new.process(params.to_h) if res.errors.present? msg = "Unable to create new customer: #{res.errors.to_sentence.capitalize}" logger.error msg ErrorReporting.error msg render text: msg, status: :bad_request else msg = "Lead #{res.customer.reference_number} created!" logger.info msg render text: msg, status: :ok end end |
#show ⇒ Object
31 32 33 |
# File 'app/controllers/api/v1/google/leads_controller.rb', line 31 def show head :ok end |