Name
ROCDownloadDocument Download a document associated with a request.
Description
ROCDownloadDocument downloads a single LOA or other document associated with a request. The following are the allowed fields in reqparams:
rocusername The username registered at SMS/800 for ROC requests.
rocpasswd The password associated with the username registered at SMS/800 for ROC requests.
entity The SMS/800 entity for ROC requests.
loaid The ID identifying this LOA document.
documentid The ID identifying this non-LOA document.
Either the single parameter entity or the pair of parameters rocusername and rocpasswd must be specified.

Either loaid or documentid must be specified.

ROC Messages
ROCDownloadDocument sends a GetLOAFile message to retrieve an LOA or it sends a GetDocument message to retrieve any other document.
Results
A RocDocumentDownload response is an XML document embedded within the normal API response. If the document is an LOA document then a GetLOAFileResponse XML document will be embedded; if the document is a non-LOA document then a GetDocumentResponse document will be embedded. Note that the response XML for these two types are different from one another.
The ErrorList section will only be included if an error has occurred.
A typical XML response for an LOA document will have the following fields.
<GetLOAFileResponse>
<StatusCode>1</StatusCode>
<LOAFile>
<FileName>LOA 01.pdf</FileName>
<EncodedContent>content omitted</EncodedContent>
<MimeType>text/pdf</MimeType>
</LOAFile>
<ErrorList>
<Error>
<Code>ErrorCode1</Code>
<Description>ErrorDescription1</Description>
<AdditionalInfo>AdditionalInfo1</AdditionalInfo>
<Error>
<ErrorList>
</GetLOAFileResponse>
A typical XML response for a non-LOA document will have the following fields.
<GetDocumentResponse>
<StatusCode>1</StatusCode>
<DocumentFile>
<DocumentID>41</DocumentID>
<FileTitle>Sample.pdf</FileTitle>
<EncodedContent>content omitted</EncodedContent>
<FileNotes>Additional information as requested.<FileNotes>
</DocumentFile>
<ErrorList>
<Error>
<Code>ErrorCode1>/Code>
<Description>ErrorDescription1</Description>
<AdditionalInfo>AdditionalInfo</AdditionalInfo>
<Error>
<ErrorList>
</GetDocumentResponse>
Most data validation is left to Somos to perform. In some cases, 8MS may provide some up-front validation. In that event, the following XML will be returned.
<err>
<code>E0000000</code>
<context>param-in-error</context>
<description>text describing error.</description>
<err>
Possible errors returned for this API call include
Code Context Description
E0000091 loaid Parameter 'loaid' is invalid
E0000092 documentid Parameter 'documentid' is invalid
E0000093 entity/rocusername A valid 'entity' or 'rocusername' must be specified.
Example
The following request parameters will retrieve a non-LOA document with a docid of 41:
entity~YH;documentid~41