@@ -4,28 +4,20 @@ const key = 'you api key'
44const trackingmore = new TrackingMore ( key )
55
66
7- try {
8- // Get all couriers (couriers/all)
9- trackingmore . couriers . getAllCouriers ( )
10- . then ( result => console . log ( result ) )
11- . catch ( e => console . log ( e ) )
12- } catch ( error ) {
13- console . error ( 'An error occurred:' , error . message )
14- }
7+ // Get all couriers (couriers/all)
8+ trackingmore . couriers . getAllCouriers ( )
9+ . then ( result => console . log ( result ) )
10+ . catch ( e => console . log ( e ) )
11+
1512
1613
17- // try {
1814// // Detect courier (couriers/detect)
1915// const params = {'tracking_number': ''}
2016// trackingmore.couriers.detect(params)
2117// .then(result => console.log(result))
2218// .catch(e => console.log(e))
23- // } catch (error) {
24- // console.error('An error occurred:', error.message)
25- // }
2619
2720
28- // try {
2921// // Create a Tracking (trackings/create)
3022// const params = {
3123// 'tracking_number': '9400111899562537624326',
3931// trackingmore.trackings.createTracking(params)
4032// .then(result => console.log(result))
4133// .catch(e => console.log(e))
42- // } catch (error) {
43- // console.error('An error occurred:', error.message)
44- // }
4534
4635
47- // try {
4836// // Get results (trackings/get)
4937// // const params = {
5038// // 'tracking_numbers': '9400111899562537624656',
6149// trackingmore.trackings.getTrackingResults(params)
6250// .then(result => console.log(result))
6351// .catch(e => console.log(e))
64- // } catch (error) {
65- // console.error('An error occurred:', error.message)
66- // }
6752
6853
69- // try {
7054// // Create trackings (trackings/batch)
7155// const params = [{
7256// 'tracking_number': '9400111899562537680047',
7862// trackingmore.trackings.batchCreateTrackings(params)
7963// .then(result => console.log(result))
8064// .catch(e => console.log(e))
81- // } catch (error) {
82- // console.error('An error occurred:', error.message)
83- // }
8465
85- // try {
8666// // Update a Tracking by ID (trackings/update)
8767// const params = {
8868// 'customer_name': 'New name',
@@ -92,40 +72,25 @@ try {
9272// trackingmore.trackings.updateTrackingByID(idString, params)
9373// .then(result => console.log(result))
9474// .catch(e => console.log(e))
95- // } catch (error) {
96- // console.error('An error occurred:', error.message)
97- // }
9875
9976
100- // try {
10177// // Delete Tracking by ID (trackings/delete)
10278// const idString = "9a135b15b5d983e1d8950d99022db0c7"
10379// trackingmore.trackings.deleteTrackingByID(idString)
10480// .then(result => console.log(result))
10581// .catch(e => console.log(e))
106- // } catch (error) {
107- // console.error('An error occurred:', error.message)
108- // }
10982
11083
111- // try {
11284// // Retrack expired Tracking by ID (trackings/retrack)
11385// const idString = "99f4ed7fc73aa83fe68fd69ab6458b28"
11486// trackingmore.trackings.retrackTrackingByID(idString)
11587// .then(result => console.log(result))
11688// .catch(e => console.log(e))
117- // } catch (error) {
118- // console.error('An error occurred:', error.message)
119- // }
12089
121- // try {
12290// // Create an air waybill (awb)
12391// const params = {
12492// 'awb_number': '235-69030430',
12593// }
12694// trackingmore.airWaybills.createAnAirWayBill(params)
12795// .then(result => console.log(result))
128- // .catch(e => console.log(e))
129- // } catch (error) {
130- // console.error('An error occurred:', error.message)
131- // }
96+ // .catch(e => console.log(e))
0 commit comments