If you are hosting content on either your local servers or Apple servers, you can use iTunes U Web Services to add content to groups in a Course page by creating a feed group or simple group respectively.
As the site administrator, you can use the content upload web service to write a program to automate the upload process. You can use this feature to, for example, support an automated lecture recording system.
To use the content upload web service, you must update your existing transfer script to generate and return just the authorization token instead of redirecting to a URL. To do this, you can either create a new script or pass an argument to your existing script.
To automatically add content to your iTunes U site using your new or updated transfer script, your upload program must:
Request an authorization token from your new or updated transfer script. This is the same authorization token used for transferring authorization data to iTunes U as described in “Transferring Authorization Data to iTunes U.” For example:
credentials=foo&identity=user&time=123456&signature=abc123abc123 |
To request the authorization token using plug-and-play, modify the iTunes U sample code provided at http://www.apple.com/support/itunes_u to return just the authorization token instead of the entire URL. Remember to send identity and password information so that your institution’s system can authenticate and authorize the request.
Request an upload URL from iTunes U by sending the authorization token from step 1 as an HTTP POST or GET to the following URL:
https://deimos.apple.com/WebObjects/Core.woa/API/GetUploadURL/example.edu.1.2.3?<authorization_token> |
The text example.edu.1.2.3 is the iTunes U destination URL for the group (folder destination on the iTunes U site) where you want to upload the content. For information on how to obtain the iTunes U destination value for a group, see “Obtaining an iTunes U URL.”
The finished URL becomes:
https://deimos.apple.com/WebObjects/Core.woa/API/GetUploadURL/example.edu.1.2.3?credentials=foo&identity=user&time=123456&signature=abc123abc123 |
An HTTP POST or GET performed on the finished URL returns another URL.
For an example of how to implement this using a UNIX curl, type:
curl https://deimos.apple.com/WebObjects/Core.woa/API/GetUploadURL/example.edu.1.2.3?credentials=foo&identity=user&time=123456&signature=abc123abc123 |
Add your content to iTunes U as an HTTP file-upload POST argument to the final URL created in step 2.
For an example of how to implement this, using the same UNIX curl example and a content file named “file,” type:
/usr/bin/curl -F file=@/path_to_file.m4a <url_from_step_2> |
iTunes U adds your content and returns the handle for the uploaded file.
For information on organizing and preparing content before adding it to your iTunes U site, see “Creating Content.”
Notes:
If your session timeout (30 minutes by default) is less than or equal to your upload timeout (60 minutes by default), iTunes U waits to start counting down your session timeout until it has successfully uploaded your content. If your session timeout is greater than or equal to your upload timeout, iTunes U starts counting down your session timeout immediately, uploads your content, and allows you to browse iTunes U until your session times out.
You can use the content upload web service to automatically add content to feed groups in a simple Course page, not in a feed Course page.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-11-03)