Module: GettyUp::API::CreateDownloadRequest

Includes:
Util
Defined in:
lib/getty_up/api/create_download_request.rb

Constant Summary collapse

ENDPOINT =
"https://connect.gettyimages.com/v1/download/CreateDownloadRequest"

Instance Method Summary collapse

Methods included from Util

#post_json

Instance Method Details

#create_download_request(download_token) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/getty_up/api/create_download_request.rb', line 10

def create_download_request(download_token)
  request = {
    :RequestHeader => {
      :Token => @secure_token,
      :CoordinationId => "MyUniqueId"
    },
    :CreateDownloadRequestBody =>
    { :DownloadItems =>
      [{
        :DownloadToken => download_token
      }]
    }
  }
  response = post_json(request, ENDPOINT)
end