README.md in intercom-3.3.0 vs README.md in intercom-3.4.0
- old
+ new
@@ -20,18 +20,21 @@
gem install intercom
Using bundler:
- gem 'intercom', "~> 3.3.0"
+ gem 'intercom', "~> 3.4.0"
## Basic Usage
### Configure your client
```ruby
intercom = Intercom::Client.new(app_id: 'my_app_id', api_key: 'my_api_key')
+
+# With an OAuth token:
+intercom = Intercom::Client.new(token: 'my_token')
```
You can get your `app_id` from the URL when you're logged into Intercom (it's the alphanumeric just after `/apps/`) and your API key from the API keys integration settings page (under your app settings - integrations in Intercom).
### Resources
@@ -77,11 +80,11 @@
# Iterate over all users
intercom.users.all.each {|user| puts %Q(#{user.email} - #{user.custom_attributes["average_monthly_spend"]}) }
intercom.users.all.map {|user| user.email }
#Bulk operations.
-# Submit bulk job, to create users
+# Submit bulk job, to create users, if any of the items in create_items match an existing user that user will be updated
intercom.users.submit_bulk_job(create_items: [{user_id: 25, email: "alice@example.com"}, {user_id: 25, email: "bob@example.com"}])
# Submit bulk job, to delete users
intercom.users.submit_bulk_job(delete_items: [{user_id: 25, email: "alice@example.com"}, {user_id: 25, email: "bob@example.com"}])
# Submit bulk job, to add items to existing job
intercom.users.submit_bulk_job(create_items: [{user_id: 25, email: "alice@example.com"}], delete_items: [{user_id: 25, email: "bob@example.com"}], job_id:'job_abcd1234')
@@ -326,10 +329,10 @@
- order_number: a Rich Link (value contains 'url' and 'value' keys)
- price: An Amount in US Dollars (value contains 'amount' and 'currency' keys)
*NB:* This version of the gem reserves the field name `type` in Event data.
-Bulk operations.
+Bulk operations.
```ruby
# Submit bulk job, to create events
intercom.events.submit_bulk_job(create_items: [
{
event_name: "ordered-item",