Class: ShipDelightApi::ShipDelight

Inherits:
Object
  • Object
show all
Defined in:
lib/ship_delight_api.rb

Class Method Summary collapse

Class Method Details

.create_ship_delight(url, cust_shipment_details) ⇒ Object



7
8
9
10
# File 'lib/ship_delight_api.rb', line 7

def self.create_ship_delight(url, cust_shipment_details)
  response = HTTParty.post(url, body: cust_shipment_details)
  result = JSON.parse(response)
end

.track_ship_delight(awb_number) ⇒ Object



12
13
14
15
16
# File 'lib/ship_delight_api.rb', line 12

def self.track_ship_delight(awb_number)
  url = "http://crm.shipdelight.com/index.php/api/example/trackAwb?awb=#{awb_number}&btn1=&format=json"
  response = HTTParty.get(url)
  result = JSON.parse(response)
end