Skip to content

Commit bc77c77

Browse files
committed
Merge pull request #15 from DripEmail/update-readme-with-accounts-example
update readme
2 parents 977295f + 667d8d3 commit bc77c77

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ for a complete API reference.
8383

8484
Here are some common use cases for the API client.
8585

86+
###Fetching user accounts
87+
88+
Once you have an access token for a Drip user, you can fetch their accounts.
89+
90+
Initialize your client and pull down the user's accounts. To make further calls, set the account_id
91+
on your client to the account you want to access.
92+
93+
```ruby
94+
client = Drip::Client.new do |c|
95+
c.access_token = "YOUR_ACCESS_TOKEN"
96+
end
97+
98+
resp = client.accounts
99+
# => <Drip::Response ...>
100+
101+
account_id = resp.accounts.first.id
102+
# => "9999999"
103+
104+
client.account_id = account_id
105+
```
106+
86107
### Fetching subscriber data
87108

88109
Subscribers can be looked up by their email address or by their Drip subscriber

0 commit comments

Comments
 (0)