You can submit finished report PDF files to the ISN with just a bit of simple information. You can also thread your upload and get upload status from the ISN to complete the perfect application for allowing users to view the progress of their upload. The ISN returns status and codes using JSON encoded values. For some this will be slighly painful to parse however, if you are in Java or .NET it should be straightfoward.
To submit a report to the ISN you must make two POST calls, first to authenticate and pick up your tokens and keys. Second, an upload post to send the file via HTTP POST. If desired you can also make POST calls to get file upload status.
First, you must understand how the ISN assembles it’s URLs. Every customer has a unique URL based on their company key. More information is available online which discusses this construction. The URL is essentially: http://inspectionsupport.net/[company_key]. Please note you can also use an SSL / HTTPS connection as well for submitting the report. Most vendors use the SSL/HTTPS connection to increase the security of passing the consumer’s user name and password in plain text over the Internet.
Make sure you watch our video example of using Microsoft’s .NET to connect to the API and upload a report.
Additionally, here is the sample Visual Studio Project that will walk through an example of sending reports to the ISN via C# / .NET.
THE LOGIN PROCESS
First, in our example we are going to use a company key of vendor. Make the following HTTP POST call initially to gain your tokens and keys:
https://inspectionsupport.net/vendor/webservice/reportupload.isn?action=login
(NOTE: If you visit this link with a browser on a GET fetch you will see it will echo out the API information)
Send the following values (HTTP POST payload):
username=[user's username]
password=[user's password in plaintext]
You will receive two JSON encoded values back: sessionid and uploadid
Both value will be used in the subsequent HTTP POST calls. If you receive empty string values for both sessionid and uploadid then your authenication failed and you have a bad username and password.
THE UPLOAD PROCESS
Next, you need to make an HTTP POST “multipart/form-data” encoded POST with your report file to the following URL:
https://inspectionsupport.net/vendor/webservice/reportupload.isn?action=upload
Send the following values (HTTP POST payload):
sessionid=[the session id you recieved in the initial login request]
uploadid=[the upload id you recieved in the initial login request]
UPLOAD_IDENTIFIER=[the upload id you recieved in the initial login request]
oid=[the customer's Order Id Number - they will need to know this - or if you initially received this information from the ISN]
reportnumber=[a customer value usually defined by 3rd party (your) application(s)]
Please note: the special UPLOAD_IDENTIFIER is only necessary if you want to query progress of the upload. This special values communicates to a high speed file progress response system we have on the ISN.
You will recieve two JSON encoded vlaues back: status and message
status will be either OK or ERROR and message will contain the error message if status was equal to ERROR
THE PROGRESS PROCESS (OPTIONAL)
If you desire to obtain the progress of the upload make sure you sent up the UPLOAD_IDENTIFIER in the original upload payload. Next make a HTTP POST query to this URL:
https://inspectionsupport.net/vendor/webservice/reportupload.isn?action=progress
Send the following values (HTTP POST payload):
sessionid=[the session id you recieved in the initial login request]
uploadid=[the upload id you recieved in the initial login request]
You will recieve three JSON encoded vlaues back: percent, speed, timeleft
percent is a double/float value that is the percentage complete (0 to 100)
speed is a text value that represents your transfer speed
timeleft is the number of seconds remaining in the transfer (will return “n/a” until of the transfer has started)
