Class: Trustpilot::Invitation
- Inherits:
-
ApiResource
- Object
- ApiResource
- Trustpilot::Invitation
- Defined in:
- lib/trustpilot/resources/invitation.rb
Constant Summary
Constants inherited from ApiResource
Instance Attribute Summary collapse
-
#business_unit_id ⇒ Object
readonly
Returns the value of attribute business_unit_id.
Instance Method Summary collapse
-
#initialize(business_unit_id = nil) ⇒ Invitation
constructor
A new instance of Invitation.
-
#service_review_link(params) ⇒ Object
Generate a unique invitation link that can be sent to a consumer by email or website.
Methods inherited from ApiResource
Constructor Details
#initialize(business_unit_id = nil) ⇒ Invitation
Returns a new instance of Invitation.
7 8 9 10 11 |
# File 'lib/trustpilot/resources/invitation.rb', line 7 def initialize business_unit_id = nil super() @business_unit_id = business_unit_id || Trustpilot.default_business_unit_id end |
Instance Attribute Details
#business_unit_id ⇒ Object (readonly)
Returns the value of attribute business_unit_id.
5 6 7 |
# File 'lib/trustpilot/resources/invitation.rb', line 5 def business_unit_id @business_unit_id end |
Instance Method Details
#service_review_link(params) ⇒ Object
Generate a unique invitation link that can be sent to a consumer by email or website. developers.trustpilot.com/invitation-api#generate-service-review-invitation-link
15 16 17 18 19 20 21 22 |
# File 'lib/trustpilot/resources/invitation.rb', line 15 def service_review_link params request( "https://invitations-api.trustpilot.com/v1/private/business-units/#{ business_unit_id }/invitation-links", auth_method: :oauth, params: params, verb: 'post' ) end |