marchex 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c89ee89614fab1b6a985eb37b971f989954f7b9
4
- data.tar.gz: 27589ec7b0eab51744ee03a5a3c28f77c449500c
3
+ metadata.gz: 0dd04c01da60af405506c24cc747523fdb9a8808
4
+ data.tar.gz: 4fedaf92eb9ffa1a8db6fd9e063587d191e60030
5
5
  SHA512:
6
- metadata.gz: de612b0b18a0d8c1049ce6c5c2eedcc69cb225851cfc1eb47ebb72b4d8bc518ce4926790999fa5ac9d5a62d8a72a4f73f87b6c0ef03f03222997e40633b67655
7
- data.tar.gz: c83e15c394dea30e47bb84d4ebea7102639feafb88809d224a5a3ba4dedc4cb123c24cbdc9cd110f0be392a0c0c861f342b507431fa3f2245e2db13696ef90e9
6
+ metadata.gz: 6ce053b434135452bbf8a474e9ae5d0d23ca53a3b1b8b85388892181cd6efa5ec86408c687907e3277d0b5d182cbffa76703db5619e30e4c845f74dc7cd6190c
7
+ data.tar.gz: 54f5ac131288ea78fbca2b9251f027cf1bb99043ef722948fd7f3fa8c08b58a56cf5ec50c837d85bcf243dbe2876c81034c4c8936912b99d49cd64209e323685
data/README.md CHANGED
@@ -44,9 +44,61 @@ Create a connection using your Marchex account email address and password:
44
44
  # @testcon.ad_custom_define(acc_id,field_number, field_name, field_type, field_values)
45
45
  Define a custom field for an ad
46
46
 
47
- # @ad_custom_set(acc_id, campaign_id, field_name, field_value)
47
+ # @testcon.ad_custom_set(acc_id, campaign_id, field_name, field_value)
48
48
  Set the value of a custom field. For boolean, use yes/no
49
49
 
50
+ # @testcon.call_search(search_options)
51
+ search_options = {}
52
+ search_options[:acct_id] Required string. The unique, system-generated account ID of the specified account.
53
+
54
+ search_options[:start] Optional (but recommended) strings. The start and end date/time of the search.
55
+ search_options[:end]
56
+
57
+ search_options[:assto] Optional string. The unique, system-generated user ID of the user assigned to the call.
58
+
59
+ search_options[:call_boundary] Optional string. Indicates whether to use the start date and time or the end date and time of the call to determine if
60
+ the call is within the dates and times specified in the start and end parameters.
61
+
62
+ search_options[:callerid] Optional string. The caller ID.
63
+
64
+ search_options[:cmpid] Optional string. The unique, system-generated campaign ID.
65
+
66
+ search_options[:dispo] Optional string. A tag added to call(s) in the call log
67
+
68
+ search_options[:dna_class] Optional string. The Call DNA classification of the call. (Conversation, Voicemail, Wrong Number, Hold-Time Abandon, IVR/Voicemail Abandon, Ring Transfer Abandon, Unknown)
69
+
70
+ search_options[:exact_times] Optional boolean. Indicates that the start and end parameters contain a datetime value.
71
+
72
+ search_options[:extended] Optional string. If not included or false, the response includes only basic information about each call
73
+
74
+ search_options[:grpid] Optional string, which can contain up to 16 characters. The unique, system-generated group ID of the ad group
75
+ for the call.
76
+
77
+ search_options[:include_dna] Optional boolean. If not included or false, Call DNA information is not returned in the results
78
+
79
+ search_options[:include_spotted_keywords] Optional boolean. If not included or false, the "spotted" keywords are not returned in the results.
80
+
81
+ search_options[:keyword] Optional string. The keyword or the Custom URL Parameter (if specified in the dynamic tracking rewrite) asso-
82
+ ciated with the call.
83
+
84
+ search_options[:min_duration_secs] Optional integer. The minimum number of seconds of the call duration
85
+
86
+ search_options[:status] Optional string. The status of the call. ANswer, BUSY, CANCEL or HANGUP, CONGESTION, NOANSWER, NOFORWARDS, VOICEMAIL, WINDDOWN
87
+
88
+ search_options[:spotted_keywords] Optional object. If specified, only calls containing one or more of the specified call transcription keywords are
89
+ returned. The spotted_keywords parameter is independent of include_spotted_keywords. agent - Filter the calls based on keywords spoken by the agent. caller - Filter the calls based on keywords spoken by the caller.
90
+ Example: spotted_keywords = {}
91
+ spotted_keywords[:agent] = ['keyword1', 'keyword2', 'keyword3']
92
+ spotted_keywords[:caller] = ['keyword1', 'keyword2', 'keyword']
93
+
94
+ search_options[:subacct] Optional boolean. true to search all calls in all client accounts of the specified parent account.
95
+
96
+ # @testcon.get_call(call_id)
97
+ Return details for a single call
98
+
99
+ # @testcon.get_call_audio(call_id, audio_format)
100
+ Gets a Base64-encoded string that contains the audio data of the specified call, in the specified format. (mp3 or wav)
101
+
50
102
  ## Development
51
103
 
52
104
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -55,7 +107,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
55
107
 
56
108
  ## Contributing
57
109
 
58
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/marchex.
110
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mhoskiso/marchex.
59
111
 
60
112
 
61
113
  ## License
@@ -10,7 +10,8 @@ require 'rest-client'
10
10
 
11
11
  module Marchex
12
12
  class Marchexapi
13
-
13
+
14
+ #RestClient.log = 'stdout' #Debugging API calls
14
15
 
15
16
  def initialize(u, p)
16
17
  @url = 'https://userapi.voicestar.com/api/jsonrpc/1'
@@ -62,9 +63,40 @@ module Marchex
62
63
  return response.body["result"]
63
64
  end
64
65
 
65
- end
66
- end
67
-
66
+ def call_search ( opts = {})
67
+ search_options = {}
68
+ search_options[:start] = opts[:start] if opts[:start]
69
+ search_options[:end] = opts[:end] if opts[:end]
70
+ search_options[:assto] = opts[:assto] if opts[:assto]
71
+ search_options[:call_boundary] = opts[:call_boundary] if opts[:call_boundary]
72
+ search_options[:callerid] = opts[:callerid] if opts[:callerid]
73
+ search_options[:cmpid] = opts[:cmpid] if opts[:cmpid]
74
+ search_options[:dispo] = opts[:dispo] if opts[:dispo]
75
+ search_options[:dna_class] = opts[:dna_class] if opts[:dna_class]
76
+ search_options[:exact_times] = opts[:exact_times] if opts[:exact_times]
77
+ search_options[:extended] = opts[:extended] if opts[:extended]
78
+ search_options[:exact_times] = true if opts[:extended] == true
79
+ search_options[:grpid] = opts[:grpid] if opts[:grpid]
80
+ search_options[:include_dna] = opts[:include_dna] if opts[:include_dna]
81
+ search_options[:include_spotted_keywords] = opts[:include_spotted_keywords] if opts[:include_spotted_keywords]
82
+ search_options[:keyword] = opts[:keyword] if opts[:keyword]
83
+ search_options[:min_duration_secs] = opts[:min_duration_secs] if opts[:min_duration_secs]
84
+ search_options[:status] = opts[:status] if opts[:status]
85
+ search_options[:spotted_keywords] = opts[:spotted_keywords] if opts[:spotted_keywords]
86
+ search_options[:subacct] = opts[:subacct] if opts[:subacct]
87
+ response = parse_json(RestClient.post(@url, {'jsonrpc' => '2.0', 'id' => '1', 'method' => 'call.search', 'params' => [opts[:acct_id], search_options ]}.to_json, :content_type => 'application/json', :accept => 'application/json', :Authorization => $auth))
88
+ return response.body["result"]
89
+ end
68
90
 
91
+ def get_call (call_id)
92
+ response = parse_json(RestClient.post(@url, {'jsonrpc' => '2.0', 'id' => '1', 'method' => 'call.get', 'params' => [call_id]}.to_json, :content_type => 'application/json', :accept => 'application/json', :Authorization => $auth))
93
+ return response.body["result"]
94
+ end
69
95
 
96
+ def get_call_audio(call_id, audio_format)
97
+ response = parse_json(RestClient.post(@url, {'jsonrpc' => '2.0', 'id' => '1', 'method' => 'call.audio', 'params' => [call_id, audio_format]}.to_json, :content_type => 'application/json', :accept => 'application/json', :Authorization => $auth))
98
+ return response.body["result"]
99
+ end
70
100
 
101
+ end
102
+ end
@@ -1,3 +1,3 @@
1
1
  module Marchex
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marchex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hoskison
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler