This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
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
1 changed file
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 1. Load UbiregiAPI library | ||
|
||
require "ubiregi_api" | ||
|
||
Make sure library search path is configured properly. | ||
|
||
# 2. Instantiate Client | ||
|
||
client = UbiregiAPI::Client.new(secret, auth_token) | ||
|
||
`secret` and `auth_token` can be found your developer page (https://ubiregi.com/developer). | ||
|
||
# 3. Send GET request | ||
|
||
client._get('customers') | ||
|
||
# 4. Send POST request | ||
|
||
client._post('customers', post_data) | ||
|
||
`post_data` must be a JSON transformable value (`Hash` or `Array`). | ||
|
||
# 5. Retrieve Whole Collection | ||
|
||
client._index('customers', 'customers') | ||
|
||
`_index` method can be used to retrieve all data included in a collection. | ||
It understands `next-url` field included in the response, and send GET request again. | ||
|