Upload Data¶
This document contains documentation for the web services for uploading data to spectr.
Uploading a scan file to spectr us a multi-step affair. The steps are:
Initiate upload of scan file with
/update/uploadScanFile_Init_XML
Use the returned key to send data to spectr. Use
/update/uploadScanFile_uploadScanFile_XML
to send data from a local file or/update/uploadScanFile_addScanFileInS3Bucket_XML
to send data from S3.Commit the submission for processing with
/update/uploadScanFile_Submit_XML
Use the returned key from 3 to query status and retrieve final hash key for uploaded file with
/update/uploadedScanFile_Status_API_Key_XML
.
Web Services Details:¶
Initiate upload of scan file¶
URI |
/update/uploadScanFile_Init_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<uploadScanFile_Init_Request></uploadScanFile_Init_Request>
|
Success Response |
Success (200 OK) |
Error Response |
Unauthorized (401) |
Sample Response |
<uploadScanFile_Init_Response>
<statusSuccess>true</statusSuccess>
<uploadScanFileTempKey>aekd838dkd</uploadScanFileTempKey>
<maxUploadFileSize>10000000000</maxUploadFileSize>
<maxUploadFileSizeFormatted>10,000,000,000</maxUploadFileSizeFormatted>
</uploadScanFile_Init_Response>
|
Response Elements |
|
Submit Data from Scan File¶
Send the contents of a scan file, byte for byte.
URI |
/update/uploadScanFile_uploadScanFile_XML |
Method |
POST |
URL Params (GET) |
|
POST data |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<UploadScanFile_UploadScanFile_Response>
<statusSuccess>true</statusSuccess>
<uploadScanFileTempKey_NotFound>false</uploadScanFileTempKey_NotFound>
<uploadedFileHasNoFilename>false</uploadedFileHasNoFilename>
<uploadedFileSuffixNotValid>false</uploadedFileSuffixNotValid>
</UploadScanFile_UploadScanFile_Response>
|
Response Elements |
|
Add Scan file in S3 Bucket¶
Submit a file to spectr, if that file is already on Amazon S3 and spectr has read access to that object. Prevents needlessly sending file.
URI |
/update/uploadScanFile_addScanFileInS3Bucket_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<uploadScanFile_AddScanFileInS3Bucket_Request
uploadScanFileTempKey=""
s3Bucket=""
s3ObjectKey=""
scanFilenameSuffix=""
s3Region=""
/>
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<uploadScanFile_AddScanFileInS3Bucket_Response
statusSuccess="true"
uploadScanFileTempKey_NotFound="false"
objectKeyOrFilenameSuffixNotValid="false"
uploadScanFileS3BucketOrObjectKey_NotFound="false"
uploadScanFileS3BucketOrObjectKey_PermissionError="false" />
|
Response attributes |
|
Commit the upload of a scan file¶
After the scan data have been sent (or a S3 object designated), this must be called to complete processing of the file
URI |
/update/uploadScanFile_Submit_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<uploadScanFile_Submit_Request
uploadScanFileTempKey=""
/>
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<uploadScanFile_Submit_Response
statusSuccess="true"
uploadScanFileTempKey_NotFound="false"
noUploadedScanFile="false"
scanProcessStatusKey="dkdk39dkd93kdkd"
/>
|
Response attributes |
|
Get the final key (API key)¶
Get the final key for the uploaded scan file (used to query data from file later).
URI |
/update/uploadedScanFile_Status_API_Key_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_UploadedScanFileInfo_Request
scanProcessStatusKey=""
/>
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_UploadedScanFileInfo_Response
scanFileAPIKey="98c11ffdfdd540676b1a137cb1a22b2a70350c9a44171d6b1180c6be5cbb2ee3f79d532c8a1dd9ef2e8e08e752a3babb"
scanProcessStatusKey_NotFound="false"
status="success"
failMessage=""
/>
|
Response attributes |
|
Delete scan processing key¶
Mark a scan processing key as deleted. Ensures not accidentally used again. Note that these keys do age and are automatically deleted with time.
URI |
/update/uploadedScanFile_Delete_For_ScanProcessStatusKey_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_UploadedScanFileInfo_Request
scanProcessStatusKey=""
/>
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<uploadScanFile_Delete_For_ScanProcessStatusKey_Request
scanProcessStatusKey_NotFound="false"
statusSuccess="true"
/>
|
Response attributes |
|