Class: DSP::API::UploadAdsInfo
- Inherits:
-
Object
- Object
- DSP::API::UploadAdsInfo
- Defined in:
- lib/dsp/api/upload_ads_info.rb
Constant Summary collapse
Class Method Summary collapse
-
.upload(options = {}) ⇒ Object
def upload(file_url = ”, dsp_order_id = Time.now.to_i).
Class Method Details
.upload(options = {}) ⇒ Object
def upload(file_url = ”, dsp_order_id = Time.now.to_i)
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dsp/api/upload_ads_info.rb', line 8 def upload( = {}) order_info = [{ "dsp_order_id"=> "#{[:dsp_order_id]}", "client_name"=> "#{[:client_name]}", "file_info"=> [{ "file_url"=> "#{[:file_url]}" }], "targeting_url"=> "#{[:targeting_url]}" , "monitor_url"=> [:monitor_url] }].to_json body = {order_info: order_info}.merge(DSP::AUTH) req = HTTParty.post(@@target_url, body: body).body JSON.parse(req) end |