-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
loops_sdk (0.1.0) | ||
loops_sdk (0.2.0) | ||
faraday | ||
|
||
GEM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,29 @@ rescue LoopsSdk::APIError => e | |
end | ||
``` | ||
|
||
## Handling rate limits | ||
|
||
You can use the check for rate limit issues with your requests. | ||
|
||
You can access details about the rate limits from the `limit` and `remaining` attributes. | ||
|
||
```ruby | ||
begin | ||
|
||
response = LoopsSdk::Contacts.update( | ||
email: "[email protected]" | ||
) | ||
|
||
render json: response | ||
|
||
rescue LoopsSdk::RateLimitError => e | ||
Rails.logger.error("Rate limit exceeded (#{e.limit} requests per second)") | ||
# Code here to re-try this request | ||
rescue LoopsSdk::APIError => e | ||
# Handle other errors | ||
end | ||
``` | ||
|
||
## Default contact properties | ||
|
||
Each contact in Loops has a set of default properties. These will always be returned in API results. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module LoopsSdk | ||
VERSION = "0.1.2" | ||
VERSION = "0.2.0" | ||
end |