www.accusoft.com
Our preparations are complete. Time to get to coding!
Code Walk-Through
Converting les using PrizmDoc’s REST API follows a four-step process:
• ●Upload File: The le to be converted is uploaded to the PrizmDoc server. It will be stored
temporarily as a Work File and assigned an identier. A Work File is part of the PrizmDoc
API:
The work le service is a temporary storage system which allows you to upload le input
and download le output. Each work le has a unique leID which can be used to pass that
le as input to a process or viewing session. It can also be used to download the raw bytes
of the le.
• Request Convert: JSON data is uploaded to the PrizmDoc server specifying the Work File
to be converted, what to convert the Work File to, and other options.
• Get Convert Status: This retrieves the status of the conversion as JSON data. When
complete, this JSON data will include the Work File ID of the converted le.
• Download File: The converted le is downloaded.
To work our way through the process, the code demonstration will make use of asynchronous
functions. This way we aren’t dependent on having the entire program wait for the
communication process to complete, and our future code can shoot o the task and proceed
when there is a response.
With that, let’s go through each step.
Add this le to our project. To make sure it gets copied to our Debug directory, click on the
GRIPPER.dwg le in the Solution Explorer. In File Properties, set the Copy to Output Directory
to Copy if newer: