mogreet 0.0.1 → 0.0.2.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -6
- data/Gemfile +1 -2
- data/README.md +49 -28
- data/Rakefile +8 -3
- data/lib/mogreet.rb +12 -8
- data/lib/mogreet/client.rb +60 -0
- data/lib/mogreet/deprecated.rb +56 -0
- data/lib/mogreet/keyword.rb +27 -0
- data/lib/mogreet/list.rb +67 -0
- data/lib/mogreet/media.rb +19 -0
- data/lib/mogreet/request.rb +19 -0
- data/lib/mogreet/response.rb +7 -0
- data/lib/mogreet/system.rb +10 -0
- data/lib/mogreet/transaction.rb +30 -0
- data/lib/mogreet/user.rb +33 -1
- data/lib/mogreet/version.rb +2 -2
- data/mogreet.gemspec +20 -19
- data/spec/cassettes/deprecated_mms.yml +53 -0
- data/spec/cassettes/keyword_add.yml +56 -0
- data/spec/cassettes/keyword_check.yml +57 -0
- data/spec/cassettes/keyword_list.yml +121 -0
- data/spec/cassettes/keyword_remove.yml +56 -0
- data/spec/cassettes/list_append.yml +61 -0
- data/spec/cassettes/list_create.yml +57 -0
- data/spec/cassettes/list_destroy.yml +56 -0
- data/spec/cassettes/list_download.yml +59 -0
- data/spec/cassettes/list_empty.yml +56 -0
- data/spec/cassettes/list_info.yml +65 -0
- data/spec/cassettes/list_list.yml +63 -0
- data/spec/cassettes/list_prune.yml +61 -0
- data/spec/cassettes/list_send.yml +56 -0
- data/spec/cassettes/media_destroy.yml +61 -0
- data/spec/cassettes/media_list.yml +72 -0
- data/spec/cassettes/media_upload.yml +3602 -0
- data/spec/cassettes/ping_invalid.yml +51 -0
- data/spec/cassettes/ping_success.yml +147 -0
- data/spec/cassettes/transaction_lookup.yml +74 -0
- data/spec/cassettes/transaction_send.yml +101 -0
- data/spec/cassettes/user_info_success.yml +56 -0
- data/spec/cassettes/user_lookup_success.yml +104 -0
- data/spec/cassettes/user_transactions_success.yml +62 -0
- data/spec/cassettes/user_uncache_success.yml +56 -0
- data/spec/deprecated_spec.rb +37 -0
- data/spec/fixtures/api.jpg +0 -0
- data/spec/keyword_spec.rb +84 -0
- data/spec/list_spec.rb +193 -0
- data/spec/media_spec.rb +67 -0
- data/spec/ping_spec.rb +43 -0
- data/spec/spec_helper.rb +26 -7
- data/spec/transaction_spec.rb +53 -0
- data/spec/user_spec.rb +66 -0
- metadata +93 -59
- data/.rspec +0 -1
- data/LICENSE +0 -22
- data/lib/mogreet/config.rb +0 -3
- data/lib/mogreet/message.rb +0 -8
- data/lib/mogreet/mogreet.rb +0 -13
- data/lib/mogreet/response/transaction_send.rb +0 -5
- data/spec/fixtures/transaction_send.xml +0 -6
- data/spec/mogreet/config_spec.rb +0 -17
- data/spec/mogreet/message_spec.rb +0 -32
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/system.ping?client_id=11111&format=json&token=xxxxxx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- leffe.mogreet.com:93
|
30
|
+
Content-Length:
|
31
|
+
- "96"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "0",
|
44
|
+
"status": "error",
|
45
|
+
"message": "Mogreet: 403 Forbidden"
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
http_version:
|
50
|
+
recorded_at: Sat, 16 Mar 2013 19:41:49 GMT
|
51
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,147 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/system.ping?client_id=42&format=json&token=ababab
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- dogtown.mogreet.com:98
|
30
|
+
Content-Length:
|
31
|
+
- "80"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "1",
|
44
|
+
"status": "success",
|
45
|
+
"message": "pong"
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
http_version:
|
50
|
+
recorded_at: Sat, 16 Mar 2013 15:50:08 GMT
|
51
|
+
- request:
|
52
|
+
method: get
|
53
|
+
uri: https://api.mogreet.com/moms/system.ping?client_id=1010101&format=json&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
54
|
+
body:
|
55
|
+
encoding: US-ASCII
|
56
|
+
string: ""
|
57
|
+
headers:
|
58
|
+
Accept:
|
59
|
+
- "*/*; q=0.5, application/xml"
|
60
|
+
Accept-Encoding:
|
61
|
+
- gzip, deflate
|
62
|
+
User-Agent:
|
63
|
+
- Ruby
|
64
|
+
response:
|
65
|
+
status:
|
66
|
+
code: 200
|
67
|
+
message: OK
|
68
|
+
headers:
|
69
|
+
Content-Type:
|
70
|
+
- text/xml
|
71
|
+
Connection:
|
72
|
+
- close
|
73
|
+
Server:
|
74
|
+
- mogreet moms api
|
75
|
+
- pserver
|
76
|
+
Host:
|
77
|
+
- pliny.mogreet.com:97
|
78
|
+
Content-Length:
|
79
|
+
- "80"
|
80
|
+
Language:
|
81
|
+
- en
|
82
|
+
Type:
|
83
|
+
- text/xml
|
84
|
+
Status:
|
85
|
+
- OK
|
86
|
+
body:
|
87
|
+
encoding: US-ASCII
|
88
|
+
string: |
|
89
|
+
{
|
90
|
+
"response": {
|
91
|
+
"code": "1",
|
92
|
+
"status": "success",
|
93
|
+
"message": "pong"
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
http_version:
|
98
|
+
recorded_at: Sat, 16 Mar 2013 19:30:22 GMT
|
99
|
+
- request:
|
100
|
+
method: get
|
101
|
+
uri: https://api.mogreet.com/moms/system.ping?client_id=1010101&format=json&token=xxxx
|
102
|
+
body:
|
103
|
+
encoding: US-ASCII
|
104
|
+
string: ""
|
105
|
+
headers:
|
106
|
+
Accept:
|
107
|
+
- "*/*; q=0.5, application/xml"
|
108
|
+
Accept-Encoding:
|
109
|
+
- gzip, deflate
|
110
|
+
User-Agent:
|
111
|
+
- Ruby
|
112
|
+
response:
|
113
|
+
status:
|
114
|
+
code: 200
|
115
|
+
message: OK
|
116
|
+
headers:
|
117
|
+
Content-Type:
|
118
|
+
- text/xml
|
119
|
+
Connection:
|
120
|
+
- close
|
121
|
+
Server:
|
122
|
+
- mogreet moms api
|
123
|
+
- pserver
|
124
|
+
Host:
|
125
|
+
- dogtown.mogreet.com:93
|
126
|
+
Content-Length:
|
127
|
+
- "96"
|
128
|
+
Language:
|
129
|
+
- en
|
130
|
+
Type:
|
131
|
+
- text/xml
|
132
|
+
Status:
|
133
|
+
- OK
|
134
|
+
body:
|
135
|
+
encoding: US-ASCII
|
136
|
+
string: |
|
137
|
+
{
|
138
|
+
"response": {
|
139
|
+
"code": "0",
|
140
|
+
"status": "error",
|
141
|
+
"message": "Mogreet: 403 Forbidden"
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
http_version:
|
146
|
+
recorded_at: Mon, 18 Mar 2013 16:24:10 GMT
|
147
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,74 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/transaction.lookup?client_id=1010101&format=json&hash=nm8ewqsd&message_id=184299036&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- leffe.mogreet.com:91
|
30
|
+
Content-Length:
|
31
|
+
- "585"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "1",
|
44
|
+
"status": "success",
|
45
|
+
"message": "transaction found",
|
46
|
+
"transaction": {
|
47
|
+
"campaign_id": "20948",
|
48
|
+
"from": "21534",
|
49
|
+
"from_name": "21534",
|
50
|
+
"to": "3108675309",
|
51
|
+
"to_name": "3108675309",
|
52
|
+
"content_id": "",
|
53
|
+
"status": "COMPLETE",
|
54
|
+
"history": [
|
55
|
+
{
|
56
|
+
"timestamp": "2013-03-18 21:06:18 -0700",
|
57
|
+
"event": "Transaction Created"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"timestamp": "2013-03-18 21:06:18 -0700",
|
61
|
+
"event": "SMS Sent"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"timestamp": "2013-03-18 21:06:18 -0700",
|
65
|
+
"event": "Transaction Complete"
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
http_version:
|
73
|
+
recorded_at: Tue, 19 Mar 2013 04:21:07 GMT
|
74
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,101 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/transaction.send?campaign_id=20948&client_id=1010101&format=json&message=hello%20world&to=3108675309&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- dogtown.mogreet.com:91
|
30
|
+
Content-Length:
|
31
|
+
- "147"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "1",
|
44
|
+
"status": "success",
|
45
|
+
"message": "API Request Accepted",
|
46
|
+
"message_id": "184299036",
|
47
|
+
"hash": "nm8ewqsd"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
http_version:
|
52
|
+
recorded_at: Tue, 19 Mar 2013 04:06:18 GMT
|
53
|
+
- request:
|
54
|
+
method: get
|
55
|
+
uri: https://api.mogreet.com/moms/transaction.lookup?client_id=1010101&format=json&hash=nm8ewqsd&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ""
|
59
|
+
headers:
|
60
|
+
Accept:
|
61
|
+
- "*/*; q=0.5, application/xml"
|
62
|
+
Accept-Encoding:
|
63
|
+
- gzip, deflate
|
64
|
+
User-Agent:
|
65
|
+
- Ruby
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 200
|
69
|
+
message: OK
|
70
|
+
headers:
|
71
|
+
Content-Type:
|
72
|
+
- text/xml
|
73
|
+
Connection:
|
74
|
+
- close
|
75
|
+
Server:
|
76
|
+
- mogreet moms api
|
77
|
+
- pserver
|
78
|
+
Host:
|
79
|
+
- leffe.mogreet.com:91
|
80
|
+
Content-Length:
|
81
|
+
- "112"
|
82
|
+
Language:
|
83
|
+
- en
|
84
|
+
Type:
|
85
|
+
- text/xml
|
86
|
+
Status:
|
87
|
+
- BAD_REQUEST
|
88
|
+
body:
|
89
|
+
encoding: US-ASCII
|
90
|
+
string: |
|
91
|
+
{
|
92
|
+
"response": {
|
93
|
+
"code": "0",
|
94
|
+
"status": "error",
|
95
|
+
"message": "Mogreet: Required Parameter(s) Missing"
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
http_version:
|
100
|
+
recorded_at: Tue, 19 Mar 2013 04:19:23 GMT
|
101
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/user.info?client_id=1010101&format=json&number=3108675309&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- dogtown.mogreet.com:92
|
30
|
+
Content-Length:
|
31
|
+
- "239"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "1",
|
44
|
+
"status": "success",
|
45
|
+
"message": "user info",
|
46
|
+
"number": "13108675309",
|
47
|
+
"carrier_id": "2",
|
48
|
+
"carrier_name": "T-Mobile",
|
49
|
+
"handset_id": "12025",
|
50
|
+
"handset_name": "Samsung Galaxy Nexus SCH-i515"
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
http_version:
|
55
|
+
recorded_at: Sat, 16 Mar 2013 20:32:18 GMT
|
56
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,104 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.mogreet.com/moms/user.lookup?client_id=1010101&format=json&number=3108675309&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/xml
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
Server:
|
26
|
+
- mogreet moms api
|
27
|
+
- pserver
|
28
|
+
Host:
|
29
|
+
- pliny.mogreet.com:91
|
30
|
+
Content-Length:
|
31
|
+
- "247"
|
32
|
+
Language:
|
33
|
+
- en
|
34
|
+
Type:
|
35
|
+
- text/xml
|
36
|
+
Status:
|
37
|
+
- OK
|
38
|
+
body:
|
39
|
+
encoding: US-ASCII
|
40
|
+
string: |
|
41
|
+
{
|
42
|
+
"response": {
|
43
|
+
"code": "1",
|
44
|
+
"status": "success",
|
45
|
+
"message": "user info",
|
46
|
+
"number": "13108675309",
|
47
|
+
"carrier_id": "2",
|
48
|
+
"carrier_name": "T-Mobile",
|
49
|
+
"handset_id": "12025",
|
50
|
+
"handset_name": "Samsung Galaxy Nexus SCH-i515"
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
http_version:
|
55
|
+
recorded_at: Sat, 16 Mar 2013 20:01:58 GMT
|
56
|
+
- request:
|
57
|
+
method: get
|
58
|
+
uri: https://api.mogreet.com/moms/user.transactions?client_id=1010101&format=json&query=%7B:number=%3E%223108675309%22%7D&token=xyxyxyxyxyxyxyxyxyxyxyxyxyx
|
59
|
+
body:
|
60
|
+
encoding: US-ASCII
|
61
|
+
string: ""
|
62
|
+
headers:
|
63
|
+
Accept:
|
64
|
+
- "*/*; q=0.5, application/xml"
|
65
|
+
Accept-Encoding:
|
66
|
+
- gzip, deflate
|
67
|
+
User-Agent:
|
68
|
+
- Ruby
|
69
|
+
response:
|
70
|
+
status:
|
71
|
+
code: 200
|
72
|
+
message: OK
|
73
|
+
headers:
|
74
|
+
Content-Type:
|
75
|
+
- text/xml
|
76
|
+
Connection:
|
77
|
+
- close
|
78
|
+
Server:
|
79
|
+
- mogreet moms api
|
80
|
+
- pserver
|
81
|
+
Host:
|
82
|
+
- pliny.mogreet.com:93
|
83
|
+
Content-Length:
|
84
|
+
- "112"
|
85
|
+
Language:
|
86
|
+
- en
|
87
|
+
Type:
|
88
|
+
- text/xml
|
89
|
+
Status:
|
90
|
+
- BAD_REQUEST
|
91
|
+
body:
|
92
|
+
encoding: US-ASCII
|
93
|
+
string: |
|
94
|
+
{
|
95
|
+
"response": {
|
96
|
+
"code": "0",
|
97
|
+
"status": "error",
|
98
|
+
"message": "Mogreet: Required Parameter(s) Missing"
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
http_version:
|
103
|
+
recorded_at: Sat, 16 Mar 2013 20:14:24 GMT
|
104
|
+
recorded_with: VCR 2.4.0
|