bookingsync-api 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +2 -1
- data/Guardfile +3 -6
- data/README.md +11 -3
- data/bookingsync-api.gemspec +2 -2
- data/lib/bookingsync/api.rb +0 -2
- data/lib/bookingsync/api/client.rb +151 -54
- data/lib/bookingsync/api/client/amenities.rb +22 -0
- data/lib/bookingsync/api/client/billing_addresses.rb +22 -0
- data/lib/bookingsync/api/client/bookings.rb +7 -9
- data/lib/bookingsync/api/client/bookings_payments.rb +22 -0
- data/lib/bookingsync/api/client/clients.rb +43 -0
- data/lib/bookingsync/api/client/destinations.rb +22 -0
- data/lib/bookingsync/api/client/inquiries.rb +2 -2
- data/lib/bookingsync/api/client/payments.rb +53 -0
- data/lib/bookingsync/api/client/periods.rb +54 -0
- data/lib/bookingsync/api/client/photos.rb +22 -0
- data/lib/bookingsync/api/client/rates.rb +23 -0
- data/lib/bookingsync/api/client/rates_rules.rb +22 -0
- data/lib/bookingsync/api/client/rates_tables.rb +53 -0
- data/lib/bookingsync/api/client/rental_agreements.rb +50 -0
- data/lib/bookingsync/api/client/rentals.rb +39 -1
- data/lib/bookingsync/api/client/reviews.rb +31 -0
- data/lib/bookingsync/api/client/seasons.rb +53 -0
- data/lib/bookingsync/api/client/special_offers.rb +54 -0
- data/lib/bookingsync/api/relation.rb +87 -0
- data/lib/bookingsync/api/resource.rb +58 -0
- data/lib/bookingsync/api/response.rb +79 -0
- data/lib/bookingsync/api/serializer.rb +100 -0
- data/lib/bookingsync/api/version.rb +1 -1
- data/spec/bookingsync/api/client/amenities_spec.rb +12 -0
- data/spec/bookingsync/api/client/billing_addresses_spec.rb +12 -0
- data/spec/bookingsync/api/client/billings_payments_spec.rb +12 -0
- data/spec/bookingsync/api/client/bookings_spec.rb +10 -8
- data/spec/bookingsync/api/client/clients_spec.rb +55 -0
- data/spec/bookingsync/api/client/destinations_spec.rb +12 -0
- data/spec/bookingsync/api/client/inquiries_spec.rb +1 -1
- data/spec/bookingsync/api/client/payments_spec.rb +56 -0
- data/spec/bookingsync/api/client/periods_spec.rb +61 -0
- data/spec/bookingsync/api/client/photos_spec.rb +12 -0
- data/spec/bookingsync/api/client/rates_rules_spec.rb +13 -0
- data/spec/bookingsync/api/client/rates_spec.rb +12 -0
- data/spec/bookingsync/api/client/rates_tables_spec.rb +59 -0
- data/spec/bookingsync/api/client/rental_agreements_spec.rb +64 -0
- data/spec/bookingsync/api/client/rentals_spec.rb +56 -6
- data/spec/bookingsync/api/client/reviews_spec.rb +33 -0
- data/spec/bookingsync/api/client/seasons_spec.rb +61 -0
- data/spec/bookingsync/api/client/special_offers_spec.rb +63 -0
- data/spec/bookingsync/api/client_spec.rb +31 -10
- data/spec/bookingsync/api/relation_spec.rb +72 -0
- data/spec/bookingsync/api/resource_spec.rb +79 -0
- data/spec/bookingsync/api/response_spec.rb +66 -0
- data/spec/cassettes/BookingSync_API_Client_Amenities/_amenities/returns_amenities.yml +72 -0
- data/spec/cassettes/BookingSync_API_Client_BillingAddresses/_billing_addresses/returns_billing_addresses.yml +65 -0
- data/spec/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_a_block/yields_block_with_batch_of_bookings.yml +12 -12
- data/spec/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_auto_paginate_true/returns_all_bookings_joined_from_many_requests.yml +12 -12
- data/spec/cassettes/BookingSync_API_Client_Bookings/_bookings/pagination/with_per_page_setting/returns_limited_number_of_bookings.yml +3 -3
- data/spec/cassettes/BookingSync_API_Client_Bookings/_clients/returns_clients.yml +66 -0
- data/spec/cassettes/BookingSync_API_Client_Bookings/_create_booking/creates_a_booking.yml +1 -1
- data/spec/cassettes/BookingSync_API_Client_Bookings/_create_client/creates_a_new_client.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Bookings/_edit_booking/updates_given_booking_by_ID.yml +18 -14
- data/spec/cassettes/BookingSync_API_Client_Bookings/_edit_client/updates_given_client_by_ID.yml +62 -0
- data/spec/cassettes/BookingSync_API_Client_BookingsPayments/_bookings_payments/returns_bookings_payments.yml +65 -0
- data/spec/cassettes/BookingSync_API_Client_Destinations/_destinations/returns_destinations.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Inquiries/_create_inquiry/creates_a_new_inquiry.yml +1 -1
- data/spec/cassettes/BookingSync_API_Client_Inquiries/_inquiries/returns_inquiries.yml +1 -1
- data/spec/cassettes/BookingSync_API_Client_Payments/_cancel_payment/cancels_given_payment.yml +57 -0
- data/spec/cassettes/BookingSync_API_Client_Payments/_create_payment/creates_a_new_payment.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_Payments/_edit_payment/updates_given_payment_by_ID.yml +61 -0
- data/spec/cassettes/BookingSync_API_Client_Payments/_payments/returns_payments.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Periods/_create_period/creates_a_new_period.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_Periods/_delete_period/deletes_given_period.yml +70 -0
- data/spec/cassettes/BookingSync_API_Client_Periods/_edit_period/updates_given_period_by_ID.yml +61 -0
- data/spec/cassettes/BookingSync_API_Client_Periods/_periods/returns_periods.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Photos/_photos/returns_photos.yml +72 -0
- data/spec/cassettes/BookingSync_API_Client_Rates/_rates/returns_rates.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_RatesRules/_rates_rules/returns_rates_rules.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_RatesTables/_create_rates_table/creates_a_new_rates_table.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_RatesTables/_delete_rates_table/deletes_given_rates_table.yml +57 -0
- data/spec/cassettes/BookingSync_API_Client_RatesTables/_edit_rates_table/updates_given_rates_table_by_ID.yml +62 -0
- data/spec/cassettes/BookingSync_API_Client_RatesTables/_rates_tables/returns_rates_tables.yml +74 -0
- data/spec/cassettes/BookingSync_API_Client_RentalAgreements/_create_rental_agreement/creates_a_new_rental_agreement.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_RentalAgreements/_create_rental_agreement_for_booking/creates_a_new_rental_agreement.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_RentalAgreements/_create_rental_agreement_for_rental/creates_a_new_rental_agreement.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_RentalAgreements/_rental_agreements/returns_rental_agreements.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_cancel_rental/cancels_given_rental.yml +57 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_create_rental/creates_a_new_rental.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_edit_rental/updates_given_rental_by_ID.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_rental/returns_a_single_rental.yml +67 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_rentals/links/returns_associated_photos.yml +152 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_rentals/links/returns_links_to_associated_resources.yml +91 -0
- data/spec/cassettes/BookingSync_API_Client_Rentals/_rentals/returns_rentals.yml +45 -20
- data/spec/cassettes/BookingSync_API_Client_Reviews/_create_review/creates_a_new_review.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Reviews/_reviews/returns_reviews.yml +83 -0
- data/spec/cassettes/BookingSync_API_Client_Seasons/_create_season/creates_a_new_season.yml +64 -0
- data/spec/cassettes/BookingSync_API_Client_Seasons/_delete_season/deletes_given_season.yml +57 -0
- data/spec/cassettes/BookingSync_API_Client_Seasons/_edit_season/updates_given_season_by_ID.yml +62 -0
- data/spec/cassettes/BookingSync_API_Client_Seasons/_seasons/returns_seasons.yml +74 -0
- data/spec/cassettes/BookingSync_API_Client_SpecialOffers/_create_special_offer/creates_a_new_special_offer.yml +63 -0
- data/spec/cassettes/BookingSync_API_Client_SpecialOffers/_delete_special_offer/deletes_given_special_offer.yml +57 -0
- data/spec/cassettes/BookingSync_API_Client_SpecialOffers/_edit_special_offer/updates_given_special_offer_by_ID.yml +61 -0
- data/spec/cassettes/{BookingSync_API_Client_Rentals/_rentals/with_specified_fields_in_options/returns_rentals_with_filtered_fields.yml → BookingSync_API_Client_SpecialOffers/_special_offers/returns_special_offers.yml} +17 -10
- data/spec/spec_helper.rb +1 -0
- metadata +143 -7
- data/lib/bookingsync/ext/resource.rb +0 -9
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BookingSync::API::Response do
|
4
|
+
let(:headers) {
|
5
|
+
{'Link' => '</rentals?page=2>; rel="next", </rentals?page=19>; rel="last"',
|
6
|
+
'Content-Type' => 'application/json'}
|
7
|
+
}
|
8
|
+
let(:links) {
|
9
|
+
{:'rentals.photos' => 'https://www.bookingsync.com/api/v3/photos/{rentals.photos}'}
|
10
|
+
}
|
11
|
+
let(:rentals) { [
|
12
|
+
{id: 1, name: 'rental 1', photos: [1, 43]},
|
13
|
+
{id: 2, name: 'rental 2'}
|
14
|
+
] }
|
15
|
+
let(:response) do
|
16
|
+
stubs = Faraday::Adapter::Test::Stubs.new
|
17
|
+
client = BookingSync::API::Client.new(test_access_token,
|
18
|
+
base_url: "http://foo.com") do |conn|
|
19
|
+
conn.builder.handlers.delete(Faraday::Adapter::NetHttp)
|
20
|
+
conn.adapter :test, @stubs do |stub|
|
21
|
+
stub.get '/rentals' do
|
22
|
+
body = {links: links, rentals: rentals}.to_json
|
23
|
+
[200, headers, body]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
client.call(:get, '/rentals')
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#resources_key" do
|
31
|
+
it "returns name of the hash key where resources are" do
|
32
|
+
expect(response.resources_key).to eql(:rentals)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "#resources" do
|
37
|
+
it "returns an array of resources" do
|
38
|
+
expect(response.resources).to eql(rentals)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "#links" do
|
43
|
+
it "returns links to associated resources" do
|
44
|
+
expect(response.links).to eql(links)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "#status" do
|
49
|
+
it "returns HTTP response status" do
|
50
|
+
expect(response.status).to eql(200)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "#headers" do
|
55
|
+
it "returns HTTP response headers" do
|
56
|
+
expect(response.headers).to eql(headers)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "#rels" do
|
61
|
+
it "returns relations from Link header" do
|
62
|
+
expect(response.rels[:next].href).to eql('/rentals?page=2')
|
63
|
+
expect(response.rels[:last].href).to eql('/rentals?page=19')
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.bookingsync.com/api/v3/amenities
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Tue, 08 Apr 2014 13:15:29 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/vnd.api+json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Status:
|
36
|
+
- 200 OK
|
37
|
+
X-Ratelimit-Limit:
|
38
|
+
- '1000'
|
39
|
+
X-Ratelimit-Reset:
|
40
|
+
- '1396965600.0'
|
41
|
+
X-Ratelimit-Remaining:
|
42
|
+
- '999'
|
43
|
+
Link:
|
44
|
+
- <https://www.bookingsync.com/api/v3/amenities?page=1>; rel="first", <https://www.bookingsync.com/api/v3/amenities?page=1>;
|
45
|
+
rel="last"
|
46
|
+
X-Total-Pages:
|
47
|
+
- '1'
|
48
|
+
Access-Control-Allow-Origin:
|
49
|
+
- '*'
|
50
|
+
Access-Control-Request-Method:
|
51
|
+
- '*'
|
52
|
+
X-Ua-Compatible:
|
53
|
+
- IE=Edge,chrome=1
|
54
|
+
Etag:
|
55
|
+
- '"a09ddb59a9fd47403fe848bdc859b613"'
|
56
|
+
Cache-Control:
|
57
|
+
- must-revalidate, private, max-age=0
|
58
|
+
P3p:
|
59
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
60
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
61
|
+
X-Request-Id:
|
62
|
+
- 074dc47b33db3edb39248a64090b0645
|
63
|
+
X-Runtime:
|
64
|
+
- '0.269389'
|
65
|
+
X-Rack-Cache:
|
66
|
+
- miss
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"amenities":[{"id":1493,"rental_id":836,"title":"air_conditioning"}]}'
|
70
|
+
http_version:
|
71
|
+
recorded_at: Tue, 08 Apr 2014 13:15:29 GMT
|
72
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.bookingsync.com/api/v3/billing_addresses
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
X-Ratelimit-Limit:
|
26
|
+
- '1000'
|
27
|
+
X-Ratelimit-Reset:
|
28
|
+
- '1398243600'
|
29
|
+
X-Ratelimit-Remaining:
|
30
|
+
- '999'
|
31
|
+
Link:
|
32
|
+
- "<https://www.bookingsync.com/api/v3/billing_addresses?page=1>; rel=\"first\",
|
33
|
+
<https://www.bookingsync.com/api/v3/billing_addresses?page=1>; rel=\"last\""
|
34
|
+
X-Total-Pages:
|
35
|
+
- '1'
|
36
|
+
Access-Control-Allow-Origin:
|
37
|
+
- "*"
|
38
|
+
Access-Control-Request-Method:
|
39
|
+
- "*"
|
40
|
+
Content-Type:
|
41
|
+
- application/vnd.api+json; charset=utf-8
|
42
|
+
X-Ua-Compatible:
|
43
|
+
- IE=Edge
|
44
|
+
Etag:
|
45
|
+
- "\"642b0f11189d5f78e47f6e8ffa72c11c\""
|
46
|
+
Cache-Control:
|
47
|
+
- max-age=0, private, must-revalidate
|
48
|
+
P3p:
|
49
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
50
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
51
|
+
X-Request-Id:
|
52
|
+
- 06fdf0d1b76626f58d3129958a4df87b
|
53
|
+
X-Runtime:
|
54
|
+
- '0.850406'
|
55
|
+
Date:
|
56
|
+
- Wed, 23 Apr 2014 08:37:32 GMT
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
body:
|
60
|
+
encoding: UTF-8
|
61
|
+
string: "{\"billing_addresses\":[{\"id\":1,\"payment_id\":134,\"address1\":\"Nader
|
62
|
+
Drive\",\"address2\":\"\",\"zip\":\"46548-8571\",\"city\":\"Predovicview\",\"state\":\"\",\"country_code\":\"GB\",\"created_at\":\"2014-04-23T08:33:37Z\",\"updated_at\":\"2014-04-23T08:33:37Z\"}]}"
|
63
|
+
http_version:
|
64
|
+
recorded_at: Wed, 23 Apr 2014 08:37:32 GMT
|
65
|
+
recorded_with: VCR 2.9.0
|
@@ -29,9 +29,9 @@ http_interactions:
|
|
29
29
|
X-Ratelimit-Remaining:
|
30
30
|
- '959'
|
31
31
|
Link:
|
32
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
33
|
-
<https://www.bookingsync.com/api/v3/bookings
|
34
|
-
<https://www.bookingsync.com/api/v3/bookings
|
32
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
33
|
+
<https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2>; rel=\"next\",
|
34
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
35
35
|
X-Total-Pages:
|
36
36
|
- '3'
|
37
37
|
Access-Control-Allow-Origin:
|
@@ -64,7 +64,7 @@ http_interactions:
|
|
64
64
|
recorded_at: Fri, 21 Mar 2014 13:46:18 GMT
|
65
65
|
- request:
|
66
66
|
method: get
|
67
|
-
uri: https://www.bookingsync.com/api/v3/bookings
|
67
|
+
uri: https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2
|
68
68
|
body:
|
69
69
|
encoding: US-ASCII
|
70
70
|
string: ''
|
@@ -91,10 +91,10 @@ http_interactions:
|
|
91
91
|
X-Ratelimit-Remaining:
|
92
92
|
- '958'
|
93
93
|
Link:
|
94
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
95
|
-
<https://www.bookingsync.com/api/v3/bookings
|
96
|
-
<https://www.bookingsync.com/api/v3/bookings
|
97
|
-
<https://www.bookingsync.com/api/v3/bookings
|
94
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
95
|
+
<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"prev\",
|
96
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"next\",
|
97
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
98
98
|
X-Total-Pages:
|
99
99
|
- '3'
|
100
100
|
Access-Control-Allow-Origin:
|
@@ -127,7 +127,7 @@ http_interactions:
|
|
127
127
|
recorded_at: Fri, 21 Mar 2014 13:46:18 GMT
|
128
128
|
- request:
|
129
129
|
method: get
|
130
|
-
uri: https://www.bookingsync.com/api/v3/bookings
|
130
|
+
uri: https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2
|
131
131
|
body:
|
132
132
|
encoding: US-ASCII
|
133
133
|
string: ''
|
@@ -154,9 +154,9 @@ http_interactions:
|
|
154
154
|
X-Ratelimit-Remaining:
|
155
155
|
- '957'
|
156
156
|
Link:
|
157
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
158
|
-
<https://www.bookingsync.com/api/v3/bookings
|
159
|
-
<https://www.bookingsync.com/api/v3/bookings
|
157
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
158
|
+
<https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2>; rel=\"prev\",
|
159
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
160
160
|
X-Total-Pages:
|
161
161
|
- '3'
|
162
162
|
Access-Control-Allow-Origin:
|
@@ -29,9 +29,9 @@ http_interactions:
|
|
29
29
|
X-Ratelimit-Remaining:
|
30
30
|
- '956'
|
31
31
|
Link:
|
32
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
33
|
-
<https://www.bookingsync.com/api/v3/bookings
|
34
|
-
<https://www.bookingsync.com/api/v3/bookings
|
32
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
33
|
+
<https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2>; rel=\"next\",
|
34
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
35
35
|
X-Total-Pages:
|
36
36
|
- '3'
|
37
37
|
Access-Control-Allow-Origin:
|
@@ -64,7 +64,7 @@ http_interactions:
|
|
64
64
|
recorded_at: Fri, 21 Mar 2014 13:46:19 GMT
|
65
65
|
- request:
|
66
66
|
method: get
|
67
|
-
uri: https://www.bookingsync.com/api/v3/bookings
|
67
|
+
uri: https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2
|
68
68
|
body:
|
69
69
|
encoding: US-ASCII
|
70
70
|
string: ''
|
@@ -91,10 +91,10 @@ http_interactions:
|
|
91
91
|
X-Ratelimit-Remaining:
|
92
92
|
- '955'
|
93
93
|
Link:
|
94
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
95
|
-
<https://www.bookingsync.com/api/v3/bookings
|
96
|
-
<https://www.bookingsync.com/api/v3/bookings
|
97
|
-
<https://www.bookingsync.com/api/v3/bookings
|
94
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
95
|
+
<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"prev\",
|
96
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"next\",
|
97
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
98
98
|
X-Total-Pages:
|
99
99
|
- '3'
|
100
100
|
Access-Control-Allow-Origin:
|
@@ -127,7 +127,7 @@ http_interactions:
|
|
127
127
|
recorded_at: Fri, 21 Mar 2014 13:46:19 GMT
|
128
128
|
- request:
|
129
129
|
method: get
|
130
|
-
uri: https://www.bookingsync.com/api/v3/bookings
|
130
|
+
uri: https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2
|
131
131
|
body:
|
132
132
|
encoding: US-ASCII
|
133
133
|
string: ''
|
@@ -154,9 +154,9 @@ http_interactions:
|
|
154
154
|
X-Ratelimit-Remaining:
|
155
155
|
- '954'
|
156
156
|
Link:
|
157
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
158
|
-
<https://www.bookingsync.com/api/v3/bookings
|
159
|
-
<https://www.bookingsync.com/api/v3/bookings
|
157
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
158
|
+
<https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2>; rel=\"prev\",
|
159
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
160
160
|
X-Total-Pages:
|
161
161
|
- '3'
|
162
162
|
Access-Control-Allow-Origin:
|
@@ -29,9 +29,9 @@ http_interactions:
|
|
29
29
|
X-Ratelimit-Remaining:
|
30
30
|
- '953'
|
31
31
|
Link:
|
32
|
-
- "<https://www.bookingsync.com/api/v3/bookings
|
33
|
-
<https://www.bookingsync.com/api/v3/bookings
|
34
|
-
<https://www.bookingsync.com/api/v3/bookings
|
32
|
+
- "<https://www.bookingsync.com/api/v3/bookings?page=1&per_page=2>; rel=\"first\",
|
33
|
+
<https://www.bookingsync.com/api/v3/bookings?page=2&per_page=2>; rel=\"next\",
|
34
|
+
<https://www.bookingsync.com/api/v3/bookings?page=3&per_page=2>; rel=\"last\""
|
35
35
|
X-Total-Pages:
|
36
36
|
- '3'
|
37
37
|
Access-Control-Allow-Origin:
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.bookingsync.com/api/v3/clients
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
X-Ratelimit-Limit:
|
26
|
+
- '1000'
|
27
|
+
X-Ratelimit-Reset:
|
28
|
+
- '1397512800'
|
29
|
+
X-Ratelimit-Remaining:
|
30
|
+
- '995'
|
31
|
+
Link:
|
32
|
+
- <https://www.bookingsync.com/api/v3/clients?page=1>; rel="first", <https://www.bookingsync.com/api/v3/clients?page=1>;
|
33
|
+
rel="last"
|
34
|
+
X-Total-Pages:
|
35
|
+
- '1'
|
36
|
+
Access-Control-Allow-Origin:
|
37
|
+
- '*'
|
38
|
+
Access-Control-Request-Method:
|
39
|
+
- '*'
|
40
|
+
Content-Type:
|
41
|
+
- application/vnd.api+json; charset=utf-8
|
42
|
+
X-Ua-Compatible:
|
43
|
+
- IE=Edge
|
44
|
+
Etag:
|
45
|
+
- '"6e81308b8f347718bda235c6df6a1844"'
|
46
|
+
Cache-Control:
|
47
|
+
- max-age=0, private, must-revalidate
|
48
|
+
P3p:
|
49
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
50
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
51
|
+
X-Request-Id:
|
52
|
+
- 07022bc524a0d02d96dd7c435c9413ee
|
53
|
+
X-Runtime:
|
54
|
+
- '0.050475'
|
55
|
+
Date:
|
56
|
+
- Mon, 14 Apr 2014 21:17:01 GMT
|
57
|
+
Connection:
|
58
|
+
- close
|
59
|
+
body:
|
60
|
+
encoding: UTF-8
|
61
|
+
string: '{"clients":[{"id":2,"email":"giuseppe.king@walker.us","phone":"","mobile":null,"fax":null,"address1":"","address2":null,"city":"","state":"","zip":"","country_code":"","account_id":1,"created_at":"2014-02-11T09:13:19Z","updated_at":"2014-03-21T13:42:36Z","fullname":"Jakayla
|
62
|
+
Feest","notes":null},{"id":4,"email":"henri.jakubowski@lebsack.name","phone":"","mobile":null,"fax":null,"address1":"","address2":null,"city":"","state":"","zip":"","country_code":"","account_id":1,"created_at":"2014-02-11T09:13:24Z","updated_at":"2014-03-21T13:42:54Z","fullname":"Katelyn
|
63
|
+
Bernier I","notes":null}]}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Mon, 14 Apr 2014 21:17:01 GMT
|
66
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://www.bookingsync.com/api/v3/clients
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"clients":[{"fullname":"John Smith","phone":"11111111","mobile":"33333333","email":"smith@example.com","fax":"1111111","address1":"Italy","country_code":"IT","city":"Rome"}]}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept:
|
13
|
+
- application/vnd.api+json
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.api+json
|
16
|
+
Authorization:
|
17
|
+
- Bearer <<ACCESS_TOKEN>>
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
X-Ratelimit-Limit:
|
26
|
+
- '1000'
|
27
|
+
X-Ratelimit-Reset:
|
28
|
+
- '1397516400'
|
29
|
+
X-Ratelimit-Remaining:
|
30
|
+
- '996'
|
31
|
+
Location:
|
32
|
+
- https://www.bookingsync.com/api/v3/clients/21
|
33
|
+
Access-Control-Allow-Origin:
|
34
|
+
- '*'
|
35
|
+
Access-Control-Request-Method:
|
36
|
+
- '*'
|
37
|
+
Content-Type:
|
38
|
+
- application/vnd.api+json; charset=utf-8
|
39
|
+
X-Ua-Compatible:
|
40
|
+
- IE=Edge
|
41
|
+
Etag:
|
42
|
+
- '"f60f84f3cae91e0bb7b5a0b1f4983735"'
|
43
|
+
Cache-Control:
|
44
|
+
- max-age=0, private, must-revalidate
|
45
|
+
P3p:
|
46
|
+
- CP="OTI DSP COR CUR ADMo DEVo TAI PSAi PSDi IVAi IVDi CONi HISi TELi OTPi
|
47
|
+
OUR SAMi OTRo UNRo PUBi IND UNI STA"
|
48
|
+
Set-Cookie:
|
49
|
+
- _BookingSync_session=6f84ad4728ff2f51fd0ec06f51af6982; path=/; secure; HttpOnly
|
50
|
+
X-Request-Id:
|
51
|
+
- c511730e412109732e60d6d0c0a6720a
|
52
|
+
X-Runtime:
|
53
|
+
- '0.157385'
|
54
|
+
Date:
|
55
|
+
- Mon, 14 Apr 2014 22:04:17 GMT
|
56
|
+
Connection:
|
57
|
+
- close
|
58
|
+
body:
|
59
|
+
encoding: UTF-8
|
60
|
+
string: '{"clients":[{"id":21,"email":"smith@example.com","phone":"11111111","mobile":"33333333","fax":"1111111","address1":"Italy","address2":null,"city":"Rome","state":null,"zip":null,"country_code":"IT","account_id":1,"created_at":"2014-04-14T22:04:16Z","updated_at":"2014-04-14T22:04:16Z","fullname":"John
|
61
|
+
Smith","notes":null}]}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Mon, 14 Apr 2014 22:04:17 GMT
|
64
|
+
recorded_with: VCR 2.9.0
|