Class: BrazeAPI::Client
- Inherits:
-
Object
- Object
- BrazeAPI::Client
- Includes:
- Endpoints::SubscriptionGroups::Status, Endpoints::Users::Alias, Endpoints::Users::Delete, Endpoints::Users::Export, Endpoints::Users::Identify, Endpoints::Users::Track
- Defined in:
- lib/braze_api/client.rb
Overview
The top-level class that handles configuration and connection to the Braze API.
Constant Summary
Constants included from Endpoints::SubscriptionGroups::Status
Endpoints::SubscriptionGroups::Status::PATH
Constants included from Endpoints::Users::Delete
Endpoints::Users::Delete::PATH
Constants included from Endpoints::Users::Export
Endpoints::Users::Export::PATH
Constants included from Endpoints::Users::Identify
Endpoints::Users::Identify::PATH
Constants included from Endpoints::Users::Alias
Constants included from Endpoints::Users::Track
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
Instance Method Summary collapse
-
#initialize(api_key:, braze_url:, app_id:) ⇒ Client
constructor
A new instance of Client.
-
#post(endpoint, params: {}) ⇒ Object
Returns a parsed response from a post request.
Methods included from Endpoints::SubscriptionGroups::Status
Methods included from Endpoints::Users::Delete
Methods included from Endpoints::Users::Export
Methods included from Endpoints::Users::Identify
Methods included from Endpoints::Users::Alias
Methods included from Endpoints::Users::Track
#track, #track_attribute, #track_event, #track_purchase
Constructor Details
#initialize(api_key:, braze_url:, app_id:) ⇒ Client
Returns a new instance of Client.
25 26 27 28 29 |
# File 'lib/braze_api/client.rb', line 25 def initialize(api_key:, braze_url:, app_id:) @api_key = api_key @braze_url = braze_url @app_id = app_id end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
17 18 19 |
# File 'lib/braze_api/client.rb', line 17 def app_id @app_id end |
Instance Method Details
#post(endpoint, params: {}) ⇒ Object
Returns a parsed response from a post request
32 33 34 35 |
# File 'lib/braze_api/client.rb', line 32 def post(endpoint, params: {}) response = client.post(endpoint, params.to_json) JSON.parse(response.body) end |