telerivet 1.4.0 → 1.4.1

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: 2d2fced513f7484cd8ea41bc16c1e95a20dbe18d
4
- data.tar.gz: e4fc99c1924272a9872262ece7f291c6f92060b4
3
+ metadata.gz: 697a171fa7f4dd7705e613d73bf33fd107c928c4
4
+ data.tar.gz: 62ef06d6e833150e6e0a46973b69367928e91aa3
5
5
  SHA512:
6
- metadata.gz: f027ddecadb6e32b3dded7c0ee27b4d7afeede434d02848bc2a23f69186765e2bc77ec0dac6cc4bde926d0959b889e29bf76490037bb24ce19cb772874c21c82
7
- data.tar.gz: 82ccab2d76a1b30183d39945d958901fe85ab575003fa1341aca0d5087d3b3a277cd19d0f96126d9a4ad1e01e9de8252556c20e3b0ab8d48b504005d6f869790
6
+ metadata.gz: 241260c22dec5140842dcd15dcf92aa0d0db1d53bcf12e3868e32460f655e33e81a2512b5d4dac31191c9e42e28333cb316d4aea7681fdb1afcd08818e122415
7
+ data.tar.gz: fabe4e4197badab25b4de98449b50ef6ae2c64c3f14d56c6d1f5cb0ea490ebaacffe7dec528399017f13468be5a037593e82127c6a46ca0d1dce57dcf13eab95
data/lib/telerivet.rb CHANGED
@@ -9,7 +9,7 @@ module Telerivet
9
9
  class API
10
10
  attr_reader :num_requests
11
11
 
12
- @@client_version = '1.4.0'
12
+ @@client_version = '1.4.1'
13
13
 
14
14
  #
15
15
  # Initializes a client handle to the Telerivet REST API.
@@ -512,6 +512,57 @@ class Project < Entity
512
512
  Contact.new(@api, @api.do_request("POST", get_base_api_path() + "/contacts", options))
513
513
  end
514
514
 
515
+ #
516
+ # Creates and/or updates up to 200 contacts in a single API call. When creating or updating a
517
+ # large number of contacts, this method is significantly faster than sending a separate API
518
+ # request for each contact.
519
+ #
520
+ # By default, if the phone number for any contact matches an existing
521
+ # contact, the existing contact will be updated with any information provided. This behavior
522
+ # can be modified by setting the `lookup_key` parameter to look up contacts by another field,
523
+ # including a custom variable.
524
+ #
525
+ # If any contact was not found matching the provided `lookup_key`, a
526
+ # new contact will be created.
527
+ #
528
+ # Arguments:
529
+ # - options (Hash)
530
+ # * Required
531
+ #
532
+ # - contacts (array)
533
+ # * Array of up to 200 objects which may contain the properties `name` (string),
534
+ # `phone_number` (string), `vars` (object), and `send_blocked` (boolean). All
535
+ # properties are optional, unless used as a lookup key; however, either a `name` or
536
+ # `phone_number` property must be provided for new contacts.
537
+ # * Required
538
+ #
539
+ # - lookup_key
540
+ # * The field used to search for a matching contact, or 'none' to always create a new
541
+ # contact. To search by a custom variable, precede the variable name with 'vars.'.
542
+ # * Allowed values: phone_number, id, vars.variable_name, none
543
+ # * Default: phone_number
544
+ #
545
+ # - add_group_ids (array)
546
+ # * ID of one or more groups to add these contacts as members (max 5)
547
+ #
548
+ # - remove_group_ids (array)
549
+ # * ID of one or more groups to remove these contacts as members (max 5)
550
+ #
551
+ # - default_route_id
552
+ # * ID of the route to use by default to send messages to these contacts
553
+ #
554
+ # Returns:
555
+ # (associative array)
556
+ # - contacts (array)
557
+ # * List of objects representing each contact, with the same length and order as
558
+ # provided in the `contacts` parameter in the API request. Each object has a string
559
+ # `id` property.
560
+ #
561
+ def import_contacts(options)
562
+ data = @api.do_request("POST", get_base_api_path() + "/import_contacts", options)
563
+ return data
564
+ end
565
+
515
566
  #
516
567
  # Queries contacts within the given project.
517
568
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telerivet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Young
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-12 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby client library for Telerivet REST API
14
14
  email: support@telerivet.com