This is the updated level of code to coincide with the IBM API Management v4.0.3.0 release.
You will also need to update your APIm server to 4.0.3.0 for this code to work.
Documentation can now be found in the official Knowledge Center rather than the older attached pdfs in earlier releases:
http://www-01.ibm.com/support/knowledgecenter/SSWHYP_4.0.0/com.ibm.apimgmt.devportal.doc/capim_devportal_overview.html?lang=en