Safe Creative API Web Services Reference v2 - D R A F T

work.upload.lookup

You can upload a work using the functions work.upload.lookup, work.upload.begin, work.upload.chunk and work.upload.commit

With work.upload.lookup you ask for an URL which you will use to upload the work.


REQUEST:

https://api.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&component=work.upload.lookup
&filename=long.txt
&ztime=1271749837035
&signature=668eea80a7f6654a7ec65a74583bbacbc2edc6b5


RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<workuploadlookup>
  <uploadurl>http://arena.safecreative.org</uploadurl>
  <uploadid>3c33a96c-7743-43d0-9614-db70fa46d3ad</uploadid>
</workuploadlookup>

From this point on, you will use the uploadurl to invoke the work.upload.begin, work.upload.chunk and work.upload.commit functions.

You can ask for an URL to upload a work using a traditional http multi-part POST. To do so, set the parameter bypost=true:

REQUEST:

https://api.safecreative.org/v2/
?authkey=1i5g2aaf2bz09lyo867cuimqg
&bypost=true
&component=work.upload.lookup
&filename=my+file+name
&ztime=1271749837445
&signature=68b97266ea439203402ac496f27016a01878290a


RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<workuploadlookup>
  <uploadurl>http://arena.safecreative.org/api-upload</uploadurl>
  <uploadid>c5866e13-6d9a-41a5-9578-eacba8c80e02</uploadid>
</workuploadlookup>

Now post the content to the url obtained above (http://arena.safecreative.org/api-upload) with the required parameter uploadid:

RESPONSE (upload ticket):
HvWIbGj7anDefJK3tQHdPze8ekYaVUQJgKw_N6t0Wd_UblANNOjyVfkyK0fgPXRPgiR8SyVr7HmS4Uiiediu6MlFVYIcjUD0zc4Kc8m3e2Irr14iQi-A215pEaqlvOSZ6WUIbWvY-GD2e8akWxhESdnFG088_nUHEsAjkOvnF-ogK144M4vLuIj4Ylc6inW-80LNnqH10kh7zMJcxsv0lZzTMGrXa2pN

Now you can register this work with the upload ticket obtained above. See work.upload.commit and work.register calls.

TOC