trackingmore 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +45 -25
- data/examples/air_waybill_example.rb +3 -1
- data/examples/courier_example.rb +4 -0
- data/examples/tracking_example.rb +13 -1
- data/lib/trackingmore/air_waybill.rb +1 -1
- data/lib/trackingmore/const.rb +1 -1
- data/lib/trackingmore.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e87ed9247d12e106d7b60173494973ea2fb7d6109890c03404710478f2f3460
|
|
4
|
+
data.tar.gz: 0537b2b9347d27a974d8a0db071196cf2fed61a3c8af0f1be374ea7d93222d6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c96945e8ee4232a5f5ced2d013743060a7e0b6824ff45ef7ba6740418c968c0836131701fbdfb44e86fd58cdab6164004993f10ea60d0585303cfe64a204a3eb
|
|
7
|
+
data.tar.gz: 71939111d6523e9a390601a68c579f04c3ccd300b69b6d2393e268ac4d3f261d42ef288b3c66f716372ba74199246686072d8a7bf32889282739f04838d93d3b
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -38,6 +38,8 @@ begin
|
|
|
38
38
|
puts response
|
|
39
39
|
rescue TrackingMore::TrackingMoreException => e
|
|
40
40
|
puts "Caught Custom Exception: #{e.message}"
|
|
41
|
+
rescue StandardError => e
|
|
42
|
+
puts "Caught Standard Error: #{e.message}"
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
```
|
|
@@ -94,6 +96,8 @@ begin
|
|
|
94
96
|
puts response
|
|
95
97
|
rescue TrackingMore::TrackingMoreException => e
|
|
96
98
|
puts "Caught Custom Exception: #{e.message}"
|
|
99
|
+
rescue StandardError => e
|
|
100
|
+
puts "Caught Standard Error: #{e.message}"
|
|
97
101
|
end
|
|
98
102
|
```
|
|
99
103
|
|
|
@@ -106,6 +110,8 @@ begin
|
|
|
106
110
|
puts response
|
|
107
111
|
rescue TrackingMore::TrackingMoreException => e
|
|
108
112
|
puts "Caught Custom Exception: #{e.message}"
|
|
113
|
+
rescue StandardError => e
|
|
114
|
+
puts "Caught Standard Error: #{e.message}"
|
|
109
115
|
end
|
|
110
116
|
```
|
|
111
117
|
|
|
@@ -119,6 +125,8 @@ begin
|
|
|
119
125
|
puts response
|
|
120
126
|
rescue TrackingMore::TrackingMoreException => e
|
|
121
127
|
puts "Caught Custom Exception: #{e.message}"
|
|
128
|
+
rescue StandardError => e
|
|
129
|
+
puts "Caught Standard Error: #{e.message}"
|
|
122
130
|
end
|
|
123
131
|
```
|
|
124
132
|
|
|
@@ -134,6 +142,8 @@ begin
|
|
|
134
142
|
puts response
|
|
135
143
|
rescue TrackingMore::TrackingMoreException => e
|
|
136
144
|
puts "Caught Custom Exception: #{e.message}"
|
|
145
|
+
rescue StandardError => e
|
|
146
|
+
puts "Caught Standard Error: #{e.message}"
|
|
137
147
|
end
|
|
138
148
|
```
|
|
139
149
|
|
|
@@ -146,6 +156,8 @@ begin
|
|
|
146
156
|
puts response
|
|
147
157
|
rescue TrackingMore::TrackingMoreException => e
|
|
148
158
|
puts "Caught Custom Exception: #{e.message}"
|
|
159
|
+
rescue StandardError => e
|
|
160
|
+
puts "Caught Standard Error: #{e.message}"
|
|
149
161
|
end
|
|
150
162
|
```
|
|
151
163
|
|
|
@@ -159,6 +171,8 @@ begin
|
|
|
159
171
|
puts response
|
|
160
172
|
rescue TrackingMore::TrackingMoreException => e
|
|
161
173
|
puts "Caught Custom Exception: #{e.message}"
|
|
174
|
+
rescue StandardError => e
|
|
175
|
+
puts "Caught Standard Error: #{e.message}"
|
|
162
176
|
end
|
|
163
177
|
```
|
|
164
178
|
|
|
@@ -171,6 +185,8 @@ begin
|
|
|
171
185
|
puts response
|
|
172
186
|
rescue TrackingMore::TrackingMoreException => e
|
|
173
187
|
puts "Caught Custom Exception: #{e.message}"
|
|
188
|
+
rescue StandardError => e
|
|
189
|
+
puts "Caught Standard Error: #{e.message}"
|
|
174
190
|
end
|
|
175
191
|
```
|
|
176
192
|
|
|
@@ -183,6 +199,8 @@ begin
|
|
|
183
199
|
puts response
|
|
184
200
|
rescue TrackingMore::TrackingMoreException => e
|
|
185
201
|
puts "Caught Custom Exception: #{e.message}"
|
|
202
|
+
rescue StandardError => e
|
|
203
|
+
puts "Caught Standard Error: #{e.message}"
|
|
186
204
|
end
|
|
187
205
|
```
|
|
188
206
|
## Air Waybill
|
|
@@ -195,6 +213,8 @@ begin
|
|
|
195
213
|
puts response
|
|
196
214
|
rescue TrackingMore::TrackingMoreException => e
|
|
197
215
|
puts "Caught Custom Exception: #{e.message}"
|
|
216
|
+
rescue StandardError => e
|
|
217
|
+
puts "Caught Standard Error: #{e.message}"
|
|
198
218
|
end
|
|
199
219
|
```
|
|
200
220
|
|
|
@@ -203,28 +223,28 @@ end
|
|
|
203
223
|
Trackingmore uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an TrackingMore's server error.
|
|
204
224
|
|
|
205
225
|
|
|
206
|
-
Http CODE|META CODE|TYPE
|
|
207
|
-
|
|
208
|
-
200
|
|
209
|
-
400
|
|
210
|
-
400
|
|
211
|
-
400
|
|
212
|
-
400
|
|
213
|
-
400
|
|
214
|
-
400
|
|
215
|
-
400
|
|
216
|
-
400
|
|
217
|
-
400
|
|
218
|
-
400
|
|
219
|
-
400
|
|
220
|
-
400
|
|
221
|
-
400
|
|
222
|
-
400
|
|
223
|
-
400
|
|
224
|
-
401
|
|
225
|
-
403
|
|
226
|
-
404
|
|
227
|
-
429
|
|
228
|
-
500
|
|
229
|
-
500
|
|
230
|
-
500
|
|
226
|
+
| Http CODE | META CODE | TYPE | MESSAGE |
|
|
227
|
+
|-----------|-----------|------------------------------|--------------------------------------------------------------------------------------------------------------------|
|
|
228
|
+
| 200 | 200 | <code>Success</code> | Request response is successful |
|
|
229
|
+
| 400 | 400 | <code>BadRequest</code> | Request type error. Please check the API documentation for the request type of this API. |
|
|
230
|
+
| 400 | 4101 | <code>BadRequest</code> | Tracking No. already exists. |
|
|
231
|
+
| 400 | 4102 | <code>BadRequest</code> | Tracking No. no exists. Please use 「Create a tracking」 API first to create shipment. |
|
|
232
|
+
| 400 | 4103 | <code>BadRequest</code> | You have exceeded the shipment quantity of API call. The maximum quantity is 40 shipments per call. |
|
|
233
|
+
| 400 | 4110 | <code>BadRequest</code> | The value of tracking_number is invalid. |
|
|
234
|
+
| 400 | 4111 | <code>BadRequest</code> | Tracking_number is required. |
|
|
235
|
+
| 400 | 4112 | <code>BadRequest</code> | Invalid Tracking ID. |
|
|
236
|
+
| 400 | 4113 | <code>BadRequest</code> | Retrack is not allowed. You can only retrack an expired tracking. |
|
|
237
|
+
| 400 | 4120 | <code>BadRequest</code> | The value of courier_code is invalid. |
|
|
238
|
+
| 400 | 4121 | <code>BadRequest</code> | Cannot detect courier. |
|
|
239
|
+
| 400 | 4122 | <code>BadRequest</code> | Missing or invalid value of the special required fields for this courier. |
|
|
240
|
+
| 400 | 4130 | <code>BadRequest</code> | The format of Field name is invalid. |
|
|
241
|
+
| 400 | 4160 | <code>BadRequest</code> | The awb_number is required or invaild format. |
|
|
242
|
+
| 400 | 4161 | <code>BadRequest</code> | The awb airline does not support yet. |
|
|
243
|
+
| 400 | 4190 | <code>BadRequest</code> | You are reaching the maximum quota limitation, please upgrade your current plan. |
|
|
244
|
+
| 401 | 401 | <code>Unauthorized</code> | Authentication failed or has no permission. Please check and ensure your API Key is correct. |
|
|
245
|
+
| 403 | 403 | <code>Forbidden</code> | Access prohibited. The request has been refused or access is not allowed. |
|
|
246
|
+
| 404 | 404 | <code>NotFound</code> | Page does not exist. Please check and ensure your link is correct. |
|
|
247
|
+
| 429 | 429 | <code>TooManyRequests</code> | Exceeded API request limits, please try again later. Please check the API documentation for the limit of this API. |
|
|
248
|
+
| 500 | 511 | <code>ServerError</code> | Server error. Please contact us: service@trackingmore.org. |
|
|
249
|
+
| 500 | 512 | <code>ServerError</code> | Server error. Please contact us: service@trackingmore.org. |
|
|
250
|
+
| 500 | 513 | <code>ServerError</code> | Server error. Please contact us: service@trackingmore.org. |
|
data/examples/courier_example.rb
CHANGED
|
@@ -8,6 +8,8 @@ begin
|
|
|
8
8
|
puts response
|
|
9
9
|
rescue TrackingMore::TrackingMoreException => e
|
|
10
10
|
puts "Caught Custom Exception: #{e.message}"
|
|
11
|
+
rescue StandardError => e
|
|
12
|
+
puts "Caught Standard Error: #{e.message}"
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
|
|
@@ -17,4 +19,6 @@ begin
|
|
|
17
19
|
puts response
|
|
18
20
|
rescue TrackingMore::TrackingMoreException => e
|
|
19
21
|
puts "Caught Custom Exception: #{e.message}"
|
|
22
|
+
rescue StandardError => e
|
|
23
|
+
puts "Caught Standard Error: #{e.message}"
|
|
20
24
|
end
|
|
@@ -9,16 +9,20 @@ begin
|
|
|
9
9
|
puts response
|
|
10
10
|
rescue TrackingMore::TrackingMoreException => e
|
|
11
11
|
puts "Caught Custom Exception: #{e.message}"
|
|
12
|
+
rescue StandardError => e
|
|
13
|
+
puts "Caught Standard Error: #{e.message}"
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
begin
|
|
15
17
|
# params = {"tracking_numbers" => "92612903029511573130094547","courier_code"=>"usps"}
|
|
16
18
|
# params = {"tracking_numbers" => "92612903029511573130094547,92612903029511573030094548","courier_code"=>"usps"}
|
|
17
|
-
params = {"created_date_min" => "2023-
|
|
19
|
+
params = {"created_date_min" => "2023-10-09T06:00:00+00:00","created_date_max"=>"2023-10-10T13:45:00+00:00"}
|
|
18
20
|
response = TrackingMore::Tracking.get_tracking_results(params)
|
|
19
21
|
puts response
|
|
20
22
|
rescue TrackingMore::TrackingMoreException => e
|
|
21
23
|
puts "Caught Custom Exception: #{e.message}"
|
|
24
|
+
rescue StandardError => e
|
|
25
|
+
puts "Caught Standard Error: #{e.message}"
|
|
22
26
|
end
|
|
23
27
|
|
|
24
28
|
begin
|
|
@@ -27,6 +31,8 @@ begin
|
|
|
27
31
|
puts response
|
|
28
32
|
rescue TrackingMore::TrackingMoreException => e
|
|
29
33
|
puts "Caught Custom Exception: #{e.message}"
|
|
34
|
+
rescue StandardError => e
|
|
35
|
+
puts "Caught Standard Error: #{e.message}"
|
|
30
36
|
end
|
|
31
37
|
|
|
32
38
|
begin
|
|
@@ -36,6 +42,8 @@ begin
|
|
|
36
42
|
puts response
|
|
37
43
|
rescue TrackingMore::TrackingMoreException => e
|
|
38
44
|
puts "Caught Custom Exception: #{e.message}"
|
|
45
|
+
rescue StandardError => e
|
|
46
|
+
puts "Caught Standard Error: #{e.message}"
|
|
39
47
|
end
|
|
40
48
|
|
|
41
49
|
begin
|
|
@@ -44,6 +52,8 @@ begin
|
|
|
44
52
|
puts response
|
|
45
53
|
rescue TrackingMore::TrackingMoreException => e
|
|
46
54
|
puts "Caught Custom Exception: #{e.message}"
|
|
55
|
+
rescue StandardError => e
|
|
56
|
+
puts "Caught Standard Error: #{e.message}"
|
|
47
57
|
end
|
|
48
58
|
|
|
49
59
|
begin
|
|
@@ -52,4 +62,6 @@ begin
|
|
|
52
62
|
puts response
|
|
53
63
|
rescue TrackingMore::TrackingMoreException => e
|
|
54
64
|
puts "Caught Custom Exception: #{e.message}"
|
|
65
|
+
rescue StandardError => e
|
|
66
|
+
puts "Caught Standard Error: #{e.message}"
|
|
55
67
|
end
|
|
@@ -6,7 +6,7 @@ module TrackingMore
|
|
|
6
6
|
if params["awb_number"].to_s.empty?
|
|
7
7
|
raise TrackingMore::TrackingMoreException.new(TrackingMore::Consts::ErrMissingAwbNumber)
|
|
8
8
|
end
|
|
9
|
-
if params[
|
|
9
|
+
if !params['awb_number'].match(/^\d{3}[ -]?(\d{8})$/)
|
|
10
10
|
raise TrackingMore::TrackingMoreException.new(TrackingMore::Consts::ErrInvalidAirWaybillFormat)
|
|
11
11
|
end
|
|
12
12
|
TrackingMore::Request.make_request('post',"awb",params)
|
data/lib/trackingmore/const.rb
CHANGED
|
@@ -7,6 +7,6 @@ module TrackingMore
|
|
|
7
7
|
ErrMissingAwbNumber = 'Awb number cannot be empty';
|
|
8
8
|
ErrMaxTrackingNumbersExceeded = 'Max. 40 tracking numbers create in one call';
|
|
9
9
|
ErrEmptyId = 'Id cannot be empty';
|
|
10
|
-
ErrInvalidAirWaybillFormat = 'The air waybill number format is invalid
|
|
10
|
+
ErrInvalidAirWaybillFormat = 'The air waybill number format is invalid';
|
|
11
11
|
end
|
|
12
12
|
end
|
data/lib/trackingmore.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trackingmore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- trackingmore
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
80
|
version: '0'
|
|
81
81
|
requirements: []
|
|
82
|
-
rubygems_version: 3.
|
|
82
|
+
rubygems_version: 3.4.20
|
|
83
83
|
signing_key:
|
|
84
84
|
specification_version: 4
|
|
85
85
|
summary: The Ruby SDK of Trackingmore API
|