API List

API name

Descriptions

job

API to request document conversion, which can use both the GET and POST methods.

jobJson

The request method and response method is identical to job API and the conversion results are always returned to JSON response.

jobFile

API to request document conversion, which requests a change by putting the original document file binary in the Multipart Request.

jobFileJson

The request method and response method is identical to jobFile API and the conversion results are always returned to JSON response.



job

Document conversion request API, which can use both the GET and POST methods. You can call a viewer using the sync settings or receive requested information as a response.

Request

In case of GET type transmission, the Request parameter must be a value to which URL encoding is applied.

Parameter

Value

Required

Descriptions

Remarks

fileType

Local / URL / FTP

O

Sets how to access to the original file.

  • Local: specified when a local file in the viewer server is conveted.

  • URL : Specified when a file that can be accessed via web is converted.

  • FTP: Specified when a file in the FTP server is converted.

FTP settings properly work when the FTP access information is configured in the administrator settings.

convertType0 / 1

Determines the conversion type.

  • 0 : performs HTML conversion.

  • 1 : performs IMAGE conversion.

If not specified, the file will be converted to the default conversion type configured on the server. If the applicable conversion module is not installed, error may occur.

filePath
O

You can specify the path of the original file.

  • If the file type is set to URL, it specifies the URL that the server can access and download the file.


referUrl

Expresses the address of a site or bulletin board to indicate the source of original file.


downloadUrl

You can specify a URL to download an original file.
If this value is specified, a button to download the file from the URL is enabled in the viewer.

This button may not be enabled depending on the skin settings.

fid
O

Specifies the unique document ID. You are required to select and specify a unique ID for each document.
If the original file with the same unique ID exists on the server, the server does not collect the file again so as to improve the performance.
Document ID should be up to 255 characters. 


synctrue / false

Specifies the conversion result response time.

  • true: Waits the response from the API until the conversion is completed. After the conversion is completed, a viewer URL is returned as a 302 response.

  • false: If conversion request is received, request information is recorded and a JSON response is returned regardless of the conversion completion.

Default value: false

forcetrue / false

Specifies whether to force to perform the re-conversion regardless of server settings.

  • true: Does not use the existing conversion results and forces to perform re-conversion.

  • false: If conversion results exist, it does not perform re-conversion, and then uses the conversion results again.

Default value: false

urlEncodingUTF-8 / EUC-KR

Value used when the filetype is set to URL format, which is set identically to a value whose filePath is encoded.

  • UTF-8: Specified if the encoding value of a URL specified in the filePath is UTF-8.

  • EUC-KR: Specified if the encoding value of a URL specified in the filePath is EUC-KR.

Default value: UTF-8

convertLocaleko_KR / en_US / ja_JP / zh_CN

Specifies the locale to use for the conversion.

  • This value specifies the locale of document to use for the conversion.
  • This value specifies the locale of the skin.

Provided after v1.2.6

Default value: defaultSetting.language settings of config-properties.xml

Example:

GET {Server Address}/SynapDocViewServer/job?
									fileType=Local&convertType=0
									&filePath=/data/MSOfficeFile.docx
									&refererUrl=http://data.company.com
									&fid=L2RVwdHghdGEvTVC8TExLnEVxMB
									&force=false&urlEncoding=UTF-8
GET {Server Address}/SynapDocViewServer/job?
									fileType=URL&convertType=0
									&filePath=http://data.storage.net/MSOfficeFile.pptx
									&refererUrl=http://data.company.com
									&fid=L2RVwdHghdGEvTVC8TExLnEVxMB
									&force=false&urlEncoding=UTF-8

In case of POST type request, you can request a parameter as a JSON data.

{
    fileType: "Local" | "URL" | "FTP",
    convertType: "0" | "1",
    filePath: Local path | URL | FTP,
    refererUrl: {Referer URL},
    downloadUrl: {Download URL},
    fid: {File ID},
    force: true | false,
    urlEncoding: "UTF-8" | "EUC-KR"
}

Response

If the sync parameter is set to false, the viewer is automatically activated through a 302 response.

HTTP/1.1  302
Location: http://{Server Address}/SynapDocViewServer/viewer/doc.html?key={key}&contextPath=/SynapDocViewServer

If the sync parameter is set to true, a JSON response is returned.

Item

Descriptions

Remarks

key

Identifier for the conversion request

Used at the time of other API operation such as status API

fileName

File name of the original file for conversion


resultDirPath

Save path on the server for conversion results


JSON Example:

{
    key : {key},
    fileName : {fileName},
    resultDirPath : {resultDirPath}
}



jobJson

 

The request method and response method is identical to jop API and the conversion results are always returned to JSON response. Even if the sync parameter is set to true, 302 response is not returned.
After calling jobJson API, you can check the conversion results through the status API using the key information of response JSON as appropriate according to the status.

Request

 

Requested information is identical to job API. For job API, if the sync parameter is configured, 302 response connected to the viewer is returned, while job API only returns JSON response.

Response

Response information is identical to job API. When requested, it always returns JSON response regardless of sync parameter.

jobFile

Document conversion request API, which can use only POSAT method. Using sync settings, you can call the viewer or receive requested information as a response.
What is different from job API is that it does not use the fileType and filePath parameter, and creates a multipart-request to transmit a file parameter in which file binary is included.
If the file type is specified as URL, the urlEncoding parameter is not used as well.

Request

Parameter

Value

Required

Descriptions

Remarks

file

Multipart-Request

O

Contains the original file data in a multipart-request format.


convertType0 / 1

Determines the conversion type.

  • 0 : performs HTML format conversion.

  • 1 : performs IMAGE format conversion.

If not specified, the file will be converted to the default conversion type configured on the server. If the applicable conversion module is not installed, error may occur.

referUrl

Expresses the address of a site or bulletin board to indicate the source of original file.


downloadUrl

You can specify a URL to download an original file.
If this value is specified, a button to download the file from the URL is enabled in the viewer.

This button may not be enabled depending on the skin settings.

fid
O

Specifies the unique document ID. You are required to select and specify a unique ID for each document.
If the original file with the same unique ID exists on the server, the server does not collect the file again so as to improve the performance.
Document ID should be up to 255 characters. 


synctrue / false

Specifies the conversion result response time.

  • true: Waits the response from the API until the conversion is completed. After the conversion is completed, a JSON response is returned.

  • false: If conversion request is received, request information is recorded and a JSON response is returned regardless of the conversion completion.

Default value: false

forcetrue / false

Specifies whether to force to perform the re-conversion regardless of server settings.

  • true: Does not use the existing conversion results and forces to perform re-conversion.

  • false: If conversion results exist, it does not perform re-conversion, and then uses the conversion results again.

Default value: false


Response

Returns the same JSON response as job API.

Item

Descriptions

Remarks

key

Identifier for the conversion request

Used at the time of other API operation such as status API

fileName

File name of the original file for conversion


resultDirPath

Save path on the server for conversion results


JSON Example:

{
    key : {key},
    fileName : {fileName},
    resultDirPath : {resultDirPath}
}



jobFileJson 

The request method and response method is identical to jobFile and the conversion results are always returned to JSON response.
After calling jobFileJson API, you can check the conversion results through the status API using the key information of response JSON as appropriate according to the status.

Request

Requested information is identical to jobFile API.

Response

Response information is identical to jobFile API.