Class: HubSpotSDK::Resources::Conversations::VisitorIdentification

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/conversations/visitor_identification.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VisitorIdentification

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VisitorIdentification.

Parameters:



45
46
47
# File 'lib/hubspot_sdk/resources/conversations/visitor_identification.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#generate_token(email:, first_name: nil, last_name: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::IdentificationTokenResponse

Some parameter documentations has been truncated, see Models::Conversations::VisitorIdentificationGenerateTokenParams for more details.

Generate an identification token for a website visitor who has been authenticated using your own system. An identification token returned from this API can be used to pass information about your already-authenticated visitor to the chat widget, so that it treats the visitor as a known contact. This allows support agents to recognize and assist the visitor more effectively.

Parameters:

  • email (String)

    The email of the visitor that you wish to identify

  • first_name (String)

    The first name of the visitor that you wish to identify. This value will only be

  • last_name (String)

    The last name of the visitor that you wish to identify. This value will only be

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/hubspot_sdk/resources/conversations/visitor_identification.rb', line 30

def generate_token(params)
  parsed, options =
    HubSpotSDK::Conversations::VisitorIdentificationGenerateTokenParams.dump_request(params)
  @client.request(
    method: :post,
    path: "visitor-identification/2026-03/tokens/create",
    body: parsed,
    model: HubSpotSDK::Conversations::IdentificationTokenResponse,
    options: options
  )
end