capsulecrmii 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +10 -0
- data/README.rdoc +33 -0
- data/Rakefile +9 -0
- data/capsulecrm.gemspec +23 -0
- data/examples.rb +82 -0
- data/lib/capsulecrm.rb +45 -0
- data/lib/capsulecrm/address.rb +23 -0
- data/lib/capsulecrm/base.rb +176 -0
- data/lib/capsulecrm/child.rb +24 -0
- data/lib/capsulecrm/child_collection.rb +14 -0
- data/lib/capsulecrm/collection.rb +14 -0
- data/lib/capsulecrm/contact.rb +27 -0
- data/lib/capsulecrm/custom_field.rb +41 -0
- data/lib/capsulecrm/email.rb +64 -0
- data/lib/capsulecrm/history.rb +32 -0
- data/lib/capsulecrm/history_item.rb +20 -0
- data/lib/capsulecrm/organisation.rb +41 -0
- data/lib/capsulecrm/party.rb +114 -0
- data/lib/capsulecrm/person.rb +126 -0
- data/lib/capsulecrm/phone.rb +15 -0
- data/lib/capsulecrm/record_not_found.rb +1 -0
- data/lib/capsulecrm/recorn_not_recognised.rb +1 -0
- data/lib/capsulecrm/tag.rb +12 -0
- data/lib/capsulecrm/version.rb +3 -0
- data/lib/capsulecrm/website.rb +19 -0
- data/test/create_person_test.rb +36 -0
- data/test/fixtures/responses/create_person.yml +59 -0
- data/test/fixtures/responses/party_history.yml +45 -0
- data/test/fixtures/responses/party_tags.yml +26 -0
- data/test/fixtures/responses/person_find_all.yml +28 -0
- data/test/fixtures/responses/person_find_all_with_limit.yml +26 -0
- data/test/fixtures/responses/person_find_all_with_offset.yml +28 -0
- data/test/fixtures/responses/person_find_by_id.yml +102 -0
- data/test/fixtures/responses/update_person.yml +85 -0
- data/test/fixtures/responses/update_person_without_changes.yml +28 -0
- data/test/party_dot_find_test.rb +40 -0
- data/test/party_dot_history_test.rb +29 -0
- data/test/party_dot_tags_test.rb +30 -0
- data/test/person_dot_find_all_test.rb +48 -0
- data/test/person_dot_find_by_id_test.rb +61 -0
- data/test/test_helper.rb +52 -0
- data/test/update_person_test.rb +46 -0
- metadata +131 -0
@@ -0,0 +1 @@
|
|
1
|
+
class CapsuleCRM::RecordNotFound < StandardError; end
|
@@ -0,0 +1 @@
|
|
1
|
+
class CapsuleCRM::RecordNotRecognised < StandardError; end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CapsuleCRM::Website < CapsuleCRM::Child
|
2
|
+
|
3
|
+
attr_accessor :web_address
|
4
|
+
attr_accessor :url
|
5
|
+
attr_accessor :web_service
|
6
|
+
|
7
|
+
|
8
|
+
# nodoc
|
9
|
+
def self.xml_map
|
10
|
+
map = {
|
11
|
+
'webAddress' => 'web_address',
|
12
|
+
'url' => 'url',
|
13
|
+
'webService' => 'web_service'
|
14
|
+
}
|
15
|
+
super.merge map
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
class CreatePersonTest < Test::Unit::TestCase
|
3
|
+
|
4
|
+
# nodoc
|
5
|
+
def setup
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
# nodoc
|
10
|
+
def test_success
|
11
|
+
VCR.use_cassette('create_person') do
|
12
|
+
|
13
|
+
# save a new object, check for the id
|
14
|
+
person = CapsuleCRM::Person.new
|
15
|
+
person.first_name = 'Homer'
|
16
|
+
person.last_name = 'Simpson'
|
17
|
+
assert person.save
|
18
|
+
assert !person.id.nil?
|
19
|
+
|
20
|
+
|
21
|
+
# check it was persisted
|
22
|
+
person = CapsuleCRM::Person.find person.id
|
23
|
+
assert_equal 'Homer', person.first_name
|
24
|
+
assert_equal 'Simpson', person.last_name
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
# nodoc
|
31
|
+
def teardown
|
32
|
+
WebMock.reset!
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/person
|
6
|
+
body: |
|
7
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
8
|
+
<person>
|
9
|
+
<lastName>Simpson</lastName>
|
10
|
+
<firstName>Homer</firstName>
|
11
|
+
</person>
|
12
|
+
|
13
|
+
headers:
|
14
|
+
content-type:
|
15
|
+
- text/xml
|
16
|
+
response: !ruby/struct:VCR::Response
|
17
|
+
status: !ruby/struct:VCR::ResponseStatus
|
18
|
+
code: 201
|
19
|
+
message: Created
|
20
|
+
headers:
|
21
|
+
location:
|
22
|
+
- https://[ACCOUNT-NAME].capsulecrm.com/api/party/10256313
|
23
|
+
content-type:
|
24
|
+
- text/plain; charset=UTF-8
|
25
|
+
server:
|
26
|
+
- Apache
|
27
|
+
date:
|
28
|
+
- Tue, 12 Apr 2011 12:28:36 GMT
|
29
|
+
content-length:
|
30
|
+
- "0"
|
31
|
+
set-cookie:
|
32
|
+
- "[SESSION-COOKIE]"
|
33
|
+
body:
|
34
|
+
http_version: "1.1"
|
35
|
+
- !ruby/struct:VCR::HTTPInteraction
|
36
|
+
request: !ruby/struct:VCR::Request
|
37
|
+
method: :get
|
38
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10256313
|
39
|
+
body:
|
40
|
+
headers:
|
41
|
+
user-agent:
|
42
|
+
- CapsuleCRM ruby gem
|
43
|
+
response: !ruby/struct:VCR::Response
|
44
|
+
status: !ruby/struct:VCR::ResponseStatus
|
45
|
+
code: 200
|
46
|
+
message: OK
|
47
|
+
headers:
|
48
|
+
content-type:
|
49
|
+
- "*/*"
|
50
|
+
server:
|
51
|
+
- Apache
|
52
|
+
date:
|
53
|
+
- Tue, 12 Apr 2011 12:28:38 GMT
|
54
|
+
content-length:
|
55
|
+
- "268"
|
56
|
+
set-cookie:
|
57
|
+
- "[SESSION-COOKIE]"
|
58
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><person><id>10256313</id><contacts/><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><firstName>Homer</firstName><lastName>Simpson</lastName></person>
|
59
|
+
http_version: "1.1"
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185257/history
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:31:20 GMT
|
21
|
+
content-length:
|
22
|
+
- "426"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: |
|
26
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
27
|
+
<history size="2">
|
28
|
+
<historyItem>
|
29
|
+
<id>1</id>
|
30
|
+
<type>Note</type>
|
31
|
+
<entryDate>2012-01-31T18:00:00Z</entryDate>
|
32
|
+
<creator>Creator Name</creator>
|
33
|
+
<subject>First subject</subject>
|
34
|
+
<note>This is the first note</note>
|
35
|
+
</historyItem>
|
36
|
+
<historyItem>
|
37
|
+
<id>2</id>
|
38
|
+
<type>Note</type>
|
39
|
+
<entryDate>2012-01-30T15:00:00Z</entryDate>
|
40
|
+
<creator>Creator Name</creator>
|
41
|
+
<subject>Second subject</subject>
|
42
|
+
<note>This is the second note</note>
|
43
|
+
</historyItem>
|
44
|
+
</history>
|
45
|
+
http_version: "1.1"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185257/tag
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:31:20 GMT
|
21
|
+
content-length:
|
22
|
+
- "426"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><tags size="11"><tag><name>TMT</name></tag><tag><name>Industrials</name></tag><tag><name>Energy</name></tag><tag><name>Consumer</name></tag><tag><name>Healthcare</name></tag><tag><name>Professional Services</name></tag><tag><name>Mid-cap</name></tag><tag><name>Large-cap</name></tag><tag><name>EU</name></tag><tag><name>Asia</name></tag><tag><name>USA</name></tag></tags>
|
26
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party?
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:31:18 GMT
|
21
|
+
content-length:
|
22
|
+
- "3305"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: |-
|
26
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><parties size="8"><person><id>9719416</id><contacts><email><id>17716757</id><emailAddress>at@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Prof</title><firstName>Alan</firstName><lastName>Turing</lastName></person><person><id>10185304</id><contacts><email><id>18565226</id><emailAddress>cd@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Dr</title><firstName>Charles</firstName><lastName>Darwin</lastName></person><person><id>10185257</id><contacts><address><id>18565068</id><type>Office</type><street>10 Downing Street</street><city>London</city><zip>SW1A 2AA</zip><country>United Kingdom</country></address><email><id>18565066</id><type>Work</type><emailAddress>pm@example.com</emailAddress></email><phone><id>18566503</id><phoneNumber>12345 67890</phoneNumber></phone><website><id>18565067</id><webAddress>http://www.number10.gov.uk/</webAddress><webService>URL</webService><url>http://www.number10.gov.uk/</url></website></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>David</firstName><lastName>Cameron</lastName><jobTitle>Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person><organisation><id>10185222</id><contacts/><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>foo.com</name></organisation><person><id>10185308</id><contacts><email><id>18565231</id><emailAddress>mc@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Ms</title><firstName>Marie</firstName><lastName>Curie</lastName></person><person><id>10185261</id><contacts><address><id>18565115</id><type>Office</type><street>Deputy Prime Minister's Office
|
27
|
+
70 Whitehall</street><city>London</city><zip>SW1A 2AS</zip><country>United Kingdom</country></address><email><id>18565116</id><type>Work</type><emailAddress>dpm@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>Nick</firstName><lastName>Clegg</lastName><jobTitle>Deputy Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person><person><id>9851220</id><contacts><email><id>18565224</id><emailAddress>tbl@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Prof</title><firstName>Tim</firstName><lastName>Berners-Lee</lastName></person><organisation><id>10185256</id><contacts><email><id>18583945</id><emailAddress>gov@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>UK Government</name></organisation></parties>
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party?limit=2
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:31:20 GMT
|
21
|
+
content-length:
|
22
|
+
- "713"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><parties size="2"><person><id>9719416</id><contacts><email><id>17716757</id><emailAddress>at@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Prof</title><firstName>Alan</firstName><lastName>Turing</lastName></person><person><id>10185304</id><contacts><email><id>18565226</id><emailAddress>cd@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Dr</title><firstName>Charles</firstName><lastName>Darwin</lastName></person></parties>
|
26
|
+
http_version: "1.1"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party?start=3
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:31:21 GMT
|
21
|
+
content-length:
|
22
|
+
- "1833"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: |-
|
26
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><parties size="5"><organisation><id>10185222</id><contacts/><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>foo.com</name></organisation><person><id>10185308</id><contacts><email><id>18565231</id><emailAddress>mc@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Ms</title><firstName>Marie</firstName><lastName>Curie</lastName></person><person><id>10185261</id><contacts><address><id>18565115</id><type>Office</type><street>Deputy Prime Minister's Office
|
27
|
+
70 Whitehall</street><city>London</city><zip>SW1A 2AS</zip><country>United Kingdom</country></address><email><id>18565116</id><type>Work</type><emailAddress>dpm@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>Nick</firstName><lastName>Clegg</lastName><jobTitle>Deputy Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person><person><id>9851220</id><contacts><email><id>18565224</id><emailAddress>tbl@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Prof</title><firstName>Tim</firstName><lastName>Berners-Lee</lastName></person><organisation><id>10185256</id><contacts><email><id>18583945</id><emailAddress>gov@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>UK Government</name></organisation></parties>
|
28
|
+
http_version: "1.1"
|
@@ -0,0 +1,102 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185256
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:34:21 GMT
|
21
|
+
content-length:
|
22
|
+
- "333"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><organisation><id>10185256</id><contacts><email><id>18583945</id><emailAddress>gov@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>UK Government</name></organisation>
|
26
|
+
http_version: "1.1"
|
27
|
+
- !ruby/struct:VCR::HTTPInteraction
|
28
|
+
request: !ruby/struct:VCR::Request
|
29
|
+
method: :get
|
30
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185257
|
31
|
+
body:
|
32
|
+
headers:
|
33
|
+
user-agent:
|
34
|
+
- CapsuleCRM ruby gem
|
35
|
+
response: !ruby/struct:VCR::Response
|
36
|
+
status: !ruby/struct:VCR::ResponseStatus
|
37
|
+
code: 200
|
38
|
+
message: OK
|
39
|
+
headers:
|
40
|
+
content-type:
|
41
|
+
- "*/*"
|
42
|
+
server:
|
43
|
+
- Apache
|
44
|
+
date:
|
45
|
+
- Tue, 12 Apr 2011 12:34:22 GMT
|
46
|
+
content-length:
|
47
|
+
- "897"
|
48
|
+
set-cookie:
|
49
|
+
- "[SESSION-COOKIE]"
|
50
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><person><id>10185257</id><contacts><address><id>18565068</id><type>Office</type><street>10 Downing Street</street><city>London</city><zip>SW1A 2AA</zip><country>United Kingdom</country></address><email><id>18565066</id><type>Work</type><emailAddress>pm@example.com</emailAddress></email><phone><id>18566503</id><phoneNumber>12345 67890</phoneNumber></phone><website><id>18565067</id><webAddress>http://www.number10.gov.uk/</webAddress><webService>URL</webService><url>http://www.number10.gov.uk/</url></website></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>David</firstName><lastName>Cameron</lastName><jobTitle>Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person>
|
51
|
+
http_version: "1.1"
|
52
|
+
- !ruby/struct:VCR::HTTPInteraction
|
53
|
+
request: !ruby/struct:VCR::Request
|
54
|
+
method: :get
|
55
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185256
|
56
|
+
body:
|
57
|
+
headers:
|
58
|
+
user-agent:
|
59
|
+
- CapsuleCRM ruby gem
|
60
|
+
response: !ruby/struct:VCR::Response
|
61
|
+
status: !ruby/struct:VCR::ResponseStatus
|
62
|
+
code: 200
|
63
|
+
message: OK
|
64
|
+
headers:
|
65
|
+
content-type:
|
66
|
+
- "*/*"
|
67
|
+
server:
|
68
|
+
- Apache
|
69
|
+
date:
|
70
|
+
- Tue, 12 Apr 2011 12:34:24 GMT
|
71
|
+
content-length:
|
72
|
+
- "333"
|
73
|
+
set-cookie:
|
74
|
+
- "[SESSION-COOKIE]"
|
75
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><organisation><id>10185256</id><contacts><email><id>18583945</id><emailAddress>gov@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>UK Government</name></organisation>
|
76
|
+
http_version: "1.1"
|
77
|
+
|
78
|
+
- !ruby/struct:VCR::HTTPInteraction
|
79
|
+
request: !ruby/struct:VCR::Request
|
80
|
+
method: :get
|
81
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/11111111
|
82
|
+
body:
|
83
|
+
headers:
|
84
|
+
user-agent:
|
85
|
+
- CapsuleCRM ruby gem
|
86
|
+
response: !ruby/struct:VCR::Response
|
87
|
+
status: !ruby/struct:VCR::ResponseStatus
|
88
|
+
code: 200
|
89
|
+
message: OK
|
90
|
+
headers:
|
91
|
+
content-type:
|
92
|
+
- "*/*"
|
93
|
+
server:
|
94
|
+
- Apache
|
95
|
+
date:
|
96
|
+
- Tue, 12 Apr 2011 12:34:24 GMT
|
97
|
+
content-length:
|
98
|
+
- "333"
|
99
|
+
set-cookie:
|
100
|
+
- "[SESSION-COOKIE]"
|
101
|
+
body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><organisation><id>10185256</id><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/org_avatar_70.png</pictureURL><name>UK Government</name></organisation>
|
102
|
+
http_version: "1.1"
|
@@ -0,0 +1,85 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185261
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
user-agent:
|
9
|
+
- CapsuleCRM ruby gem
|
10
|
+
response: !ruby/struct:VCR::Response
|
11
|
+
status: !ruby/struct:VCR::ResponseStatus
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
content-type:
|
16
|
+
- "*/*"
|
17
|
+
server:
|
18
|
+
- Apache
|
19
|
+
date:
|
20
|
+
- Tue, 12 Apr 2011 12:29:03 GMT
|
21
|
+
content-length:
|
22
|
+
- "709"
|
23
|
+
set-cookie:
|
24
|
+
- "[SESSION-COOKIE]"
|
25
|
+
body: |-
|
26
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><person><id>10185261</id><contacts><address><id>18565115</id><type>Office</type><street>Deputy Prime Minister's Office
|
27
|
+
70 Whitehall</street><city>London</city><zip>SW1A 2AS</zip><country>United Kingdom</country></address><email><id>18565116</id><type>Work</type><emailAddress>dpm@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>kciN</firstName><lastName>Clegg</lastName><jobTitle>Deputy Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person>
|
28
|
+
http_version: "1.1"
|
29
|
+
- !ruby/struct:VCR::HTTPInteraction
|
30
|
+
request: !ruby/struct:VCR::Request
|
31
|
+
method: :put
|
32
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/person/10185261
|
33
|
+
body: |
|
34
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
35
|
+
<person>
|
36
|
+
<firstName>Nick</firstName>
|
37
|
+
</person>
|
38
|
+
|
39
|
+
headers:
|
40
|
+
content-type:
|
41
|
+
- text/xml
|
42
|
+
response: !ruby/struct:VCR::Response
|
43
|
+
status: !ruby/struct:VCR::ResponseStatus
|
44
|
+
code: 200
|
45
|
+
message: OK
|
46
|
+
headers:
|
47
|
+
content-type:
|
48
|
+
- text/plain; charset=UTF-8
|
49
|
+
server:
|
50
|
+
- Apache
|
51
|
+
date:
|
52
|
+
- Tue, 12 Apr 2011 12:29:05 GMT
|
53
|
+
content-length:
|
54
|
+
- "0"
|
55
|
+
set-cookie:
|
56
|
+
- "[SESSION-COOKIE]"
|
57
|
+
body:
|
58
|
+
http_version: "1.1"
|
59
|
+
- !ruby/struct:VCR::HTTPInteraction
|
60
|
+
request: !ruby/struct:VCR::Request
|
61
|
+
method: :get
|
62
|
+
uri: https://[API-TOKEN]:x@[ACCOUNT-NAME].capsulecrm.com:443/api/party/10185261
|
63
|
+
body:
|
64
|
+
headers:
|
65
|
+
user-agent:
|
66
|
+
- CapsuleCRM ruby gem
|
67
|
+
response: !ruby/struct:VCR::Response
|
68
|
+
status: !ruby/struct:VCR::ResponseStatus
|
69
|
+
code: 200
|
70
|
+
message: OK
|
71
|
+
headers:
|
72
|
+
content-type:
|
73
|
+
- "*/*"
|
74
|
+
server:
|
75
|
+
- Apache
|
76
|
+
date:
|
77
|
+
- Tue, 12 Apr 2011 12:29:06 GMT
|
78
|
+
content-length:
|
79
|
+
- "709"
|
80
|
+
set-cookie:
|
81
|
+
- "[SESSION-COOKIE]"
|
82
|
+
body: |-
|
83
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><person><id>10185261</id><contacts><address><id>18565115</id><type>Office</type><street>Deputy Prime Minister's Office
|
84
|
+
70 Whitehall</street><city>London</city><zip>SW1A 2AS</zip><country>United Kingdom</country></address><email><id>18565116</id><type>Work</type><emailAddress>dpm@example.com</emailAddress></email></contacts><pictureURL>https://d365sd3k9yw37.cloudfront.net/a/543325/theme/default/images/person_avatar_70.png</pictureURL><title>Mr</title><firstName>Nick</firstName><lastName>Clegg</lastName><jobTitle>Deputy Prime Minister</jobTitle><organisationId>10185256</organisationId><organisationName>UK Government</organisationName></person>
|
85
|
+
http_version: "1.1"
|