Class: Trustpilot::Invitation

Inherits:
ApiResource show all
Defined in:
lib/trustpilot/resources/invitation.rb

Constant Summary

Constants inherited from ApiResource

ApiResource::MUTEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApiResource

#request

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_idObject (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

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