This section describes the reccomended procedure for asychronous uploads.
Content conversions should only be performed once the content upload has been completed. This can be enforced by performing the upload as part of a batch. Content conversions within a batch can be set as dependent on the completion of other content conversions. The reccomended practise, therefore, is to set content conversions to be dependent on the completion of the asynchronous content upload. This will guarantee that content conversions will only begin once the content has been successfully uploaded.
The recommended procedure is :
LOCATION paramater.We'll run through this process step by step, with an example webservice request/response at each phase.
Call the content upload webservice method with no inline media or media reference specified. For example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:contentUploadRequest xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <clientApplicationId>petshow</clientApplicationId> <clientApplicationCredentials>Wf</clientApplicationCredentials> <contentMetaData> <key>subject</key> <value>dog balancing biscuit on nose</value> <key>copyright</key> <value>© 2008 Acme Dog Films</value> </contentMetaData> <addressType>m</addressType> </ns2:contentUploadRequest> </soap:Body> </soap:Envelope>
This will return a unique ID under which the content can be subsequently loaded. For example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:contentUploadResponse xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <contentIdentifier>1/2/3/4/adsd/petshow</contentIdentifier> <status>200</status> </ns2:contentUploadResponse> </soap:Body> </soap:Envelope>
Create a batch to run the asynchronous upload and content conversions in:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:createContentConvertBatchRequest xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <clientApplicationId>petshow</clientApplicationId> <clientApplicationCredentials>Wf</clientApplicationCredentials> </ns2:createContentConvertBatchRequest> </soap:Body> </soap:Envelope>
This will return a the ID of the newly created batch. For example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:createContentConvertBatchResponse xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <batchId>1025</batchId> <status>200</status> </ns2:createContentConvertBatchResponse> </soap:Body> </soap:Envelope>
Create a new asynchronous content conversion assigned to the batch with the unique ID as the LOCATION paramater. For example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body> <ns2:contentConvertRequest xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <clientApplicationId>petshow</clientApplicationId> <clientApplicationCredentials>Wf</clientApplicationCredentials> <conversionId>0</conversionId> <scriptParameter> <key>LOCATION</key> <value>http://content.yospace.com/myvideo.flv</value> </scriptParameter> <restricted>true</restricted> <successUrl>http://www.site.com/callback.pl?myId=45</successUrl> <failureUrl>http://www.site.com/cb_error.pl?myId=45</failureUrl> <contentIdentifier>1/2/3/4/adsd/petshow</contentIdentifier> <addressType>m</addressType> <priority>10</priority> <batchParameters> <batchId>1025</batchId> <batchParameters/> </ns2:contentConvertRequest>
</soap:Body> </soap:Envelope>
This will return the status of the content conversion request and the job ID. The job ID will be required later when setting up the dependenices for content conversions. An example response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:contentConvertResponse xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <status>200</status> <jobId>15123</jobId> </ns2:contentConvertResponse>
</soap:Body> </soap:Envelope>
Create content a conversion which is dependent on the asynchronous content conversion and assign it to the batch. For example :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body> <ns2:contentConvertRequest xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <clientApplicationId>petshow</clientApplicationId> <clientApplicationCredentials>Wf</clientApplicationCredentials> <conversionId>1001</conversionId> <restricted>false</restricted> <successUrl>http://www.site.com/callback.pl?myId=45</successUrl> <failureUrl>http://www.site.com/cb_error.pl?myId=45</failureUrl> <contentIdentifier>1/2/3/4/adsd/petshow</contentIdentifier> <addressType>m</addressType> <priority>10</priority> <batchParameters> <batchId>1025</batchId> <prerequisiteJobId>15123</prerequisiteJobId> <batchParameters/> </ns2:contentConvertRequest>
</soap:Body> </soap:Envelope>
Start the batch. For example :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:startContentConvertBatchRequest xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <clientApplicationId>petshow</clientApplicationId> <clientApplicationCredentials>Wf</clientApplicationCredentials> <batchId>1025</batchId> </ns2:startContentConvertBatchRequest> </soap:Body> </soap:Envelope>
This will return a status code. For example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:createContentConvertBatchResponse xmlns:ns2="http://www.yospace.com/tundra/ContentService/"> <status>200</status> </ns2:createContentConvertBatchResponse> </soap:Body> </soap:Envelope>