Class: HTTPService::NaviAI

Inherits:
Object
  • Object
show all
Defined in:
lib/http_service/naviai.rb

Class Method Summary collapse

Class Method Details

.generate_csv(url, token) ⇒ Object



23
24
25
# File 'lib/http_service/naviai.rb', line 23

def self.generate_csv(url, token)
  HTTParty.post(url, headers: {"Authorization": token})
end

.start(filepath:, client_id: nil, client_type:, token:, client:, email:, is_last: false, email_count: 0, total_emails:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/http_service/naviai.rb', line 6

def self.start(filepath:, client_id: nil, client_type:, token:, client:, email:, is_last: false, email_count: 0, total_emails:)
  go_url = "#{ENV['parser_url']}/v2/metas"
  HTTParty.post(go_url,
    body:
      {
        client_id: client_id,
        client_type: client_type,
        list_meta_path: filepath,
        token: token,
        client: client,
        email: email,
        is_last: is_last,
        email_count: email_count,
        total_emails: total_emails
      }.to_json, timeout: 400)
end