Difference between revisions of "Work.upload.chunk"

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
m (7 revisions imported)
 
(One intermediate revision by one other user not shown)
Line 31: Line 31:
 
** '''state''': continue
 
** '''state''': continue
  
= Sample =
+
= Example =
 
REQUEST:
 
REQUEST:
  

Latest revision as of 08:07, 7 May 2021

Upload a part of a work contents. Work contents are sent encoded in base64. You can send a chunk more than once, and chunk order is not relevant.

This component must be called on an upload API server returned by work.upload.lookup and after having called work.upload.begin with the same server and uploadid.

When you have sent all work content chunks, you must call work.upload.commit to finish the upload process.

Info

  • Component name: work.upload.chunk
  • Signature: Requires signature using the authkey's private key
  • Timestamp: Requires ztime parameter
  • Authorization level: ADD
  • API trust level: Standard
  • API server: Upload server returned by work.upload.lookup

Parameters

  • authkey*: Authorization key
  • ztime*: Z-Timestamp
  • uploadid*: Upload ID obtained from work.upload.lookup
  • data*: Chunk contents, Base64-encoded
  • offset*: Position of the first byte of the chunk within the full file (first byte is 0)
    • If all chunks have the same size (<chunksize> bytes)
      • First chunk has offset 0
      • Second chunk has offset <chunksize>
      • Third chunk has offset 2*<chunksize>
      • ...

* Required parameter

Returns

  • workuploadchunk
    • state: continue

Example

REQUEST:

https://upload01.safecreative.org/v2/
?component=work.upload.chunk
&authkey=1i5g2aaf2bz09lyo867cuimqg
&data=VmVyeSBsb25nIGZpbGU%3D
&offset=0
&uploadid=3c33a96c-7743-43d0-9614-db70fa46d3ad
&ztime=1271749837035
&signature=f53cf9e21778719e599f6ad39bd85924ecb0bc23

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<workuploadchunk>
  <state>continue</state>
</workuploadchunk>