Skip to content

Latest commit

 

History

History
30 lines (16 loc) · 1.24 KB

README.md

File metadata and controls

30 lines (16 loc) · 1.24 KB

upload-creative-example

This is an example of uploading a new image to an existing creative using the Adzerk API Ruby gem

upload_creative.rb is a command line program that accepts a file and a creative id, and uploads the file to Adzerk.

The creative must already exist. For an example of creating a creative from scratch, and getting back a creative id, see the tests.

Running

You'll need to install Ruby 2.0 or higher for your platform if you don't already have it. This project has been tested with Ruby 2.3.1.

Once you have Ruby, you'll need to install bundler with gem i bundler or similar.

Then, install dependencies:

bundle install

Run the program to see its help output:

bundle exec upload_creative.rb -h

Set the ADZERK_API_KEY environment variable (your API key will differ):

export ADZERK_API_KEY=f00b4r1234f00b4r1234f00b4r1234

With a creative id of 1234 and a creative file called 250x300.png, you could upload with:

bundle exec upload_creative.rb -c 1234 -f 250x300.png