Work.attachfile
Attaches a file to a work.
File must be first uploaded using the upload components work.upload.lookup and then work.upload.begin, work.upload.chunk and work.upload.commit or upload servlet, in the same way you would upload a work for registering. You will obtain an upload ticket to be used in this component
'File attachment' professional service must be active for the authorizing user.
Info
- Component name: work.attachfile
- Signature: Requires signature using the authorization key's private key
- Timestamp: Requires ztime parameter
- Authorization level: MANAGE
Parameters
- authkey*: Authorization key
- ztime*: Z-Timestamp
- public: 1 if the attachment is public (downloadable from the work public page). Not public by default.
- title*: Title of the attached file
- uploadticket*: Upload ticket obtained from work.upload.commit or upload servlet
- workcode*: Work code
* Required parameter
Returns
- restvalueresponse
- state: ready
Sample
REQUEST:
https://api.safecreative.org/v2/ ?component=work.attachfile &authkey=1i5g2aaf2bz09lyo867cuimqg &public=1 &title=A+simple+attachment &uploadticket=HvWIbGj7anDefJK3tQHdPxp1swnY9x54Mr1xXCq40dg7SmFtNlOA6931SkqRyTtSaI-pk7zPbNymk_FIfu7EeH13-jBJKxHkZGJCVUsXd7S8gBqH8j-m8h18abRL1HIGOW1TiInUVAvf9uQoVbgbS-sLKCDM3BvZDO0rVJtv4wak5drfsxULmR6bc51phHvcRWVHcof1Des4FMh9dZKXCwVg_AypY2zq &workcode=1004200146116 &ztime=1271749851064 &signature=26ecbbf2e886483516a42314979323db5cb69804
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?> <restvalueresponse> <state>ready</state> </restvalueresponse>