The Upload Package method uploads a HotDocs Template Package File (.hdpkg) to Web Service API. The HotDocs Template Package File is created using HotDocs Developer. It contains files required to display an interview and assemble a document. A HotDocs Package File must be uploaded to the Service before it can be used in other Service methods, i.e. GetInterview, Assemble Document, GetComponentInfo, GetInterviewFile.
This method creates a folder within the TempFiles folder in your on premise web API solution where the package file will be uploaded. The folder is named using the package ID.
In this Topic Hide
PUT http://{machineName}:{portNumber}/HDSWebAPI/api/hdcs/{subscriberID}/{packageID}
Name | Location | Required | Description |
machineName |
Path | Yes |
The name of the server on which the Web Service is installed. |
portNumber |
Path | Yes |
The port through which the Web Service is accessible. |
subscriberID | Path | Yes |
Set this value to 0. |
packageID | Path | Yes | A package ID that will be used to identify this template package in future requests. A GUID is strongly recommended; it must at least be unique for all packages uploaded and used by this subscriber. |
packageContent | Request body | Yes | The template package itself is supplied in the request body. |
http://localhost:80/HDSWEBAPI/api/HDCS/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29?billingRef=exampleBillingRef
If successful, this method returns a 201 Created status code.
When making an Upload request to Web Services, the request must include the following headers.
Name |
Type |
Example Data |
Description |
Example (C#) |
Content-Type |
String |
application/binary |
The type of content being sent with the request. For uploading, the content is the Template Package File. |
request.Content.Headers.Add("Content-Type", "application/binary"); |
PUT http://machine-name/HDSWEBAPI/api/HDCS/0/ed40775b-5e7d-4a51-b4d1-32bf9d6e9e29 HTTP/1.1
Content-Disposition: form-data; name="files"; filename="HelloWorld.hdpkg"
Content-Type: application/binary
Host: machine-name
Content-Length: 16296
Expect: 100-continue
Connection: Keep-Alive
For a full walkthrough of uploading a template to the Web Service, see the Web Service Example 1: Uploading a Template article in the HotDocs Integrations documentation.
For a full code example of uploading a template package file to Web Services, see the WebServiceExample1Upload project in the HotDocs Integration Examples.