Class: NewStoreApi::DeviceNotificationsController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::DeviceNotificationsController
- Defined in:
- lib/new_store_api/controllers/device_notifications_controller.rb
Overview
DeviceNotificationsController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_notification(body: nil) ⇒ NotificationResponse
🚧 BETA: This endpoint is in beta and may change.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#create_notification(body: nil) ⇒ NotificationResponse
🚧 BETA: This endpoint is in beta and may change.Creates a notification for push notifications description here
See API Lifecycle Documentation for details.22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# File 'lib/new_store_api/controllers/device_notifications_controller.rb', line 22 def create_notification(body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/retail-org/devices/notifications', Server::API) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(NotificationResponse.method(:from_hash))) .execute end