Login
ITEM VALUE
URL http://<URL>/api/api/v1/login/
METHOD PUT
HEADER accept=application/xml
BODY

<user>

<username>myUsernameHere</username>

<password>myPasswordHere</password>

</user>

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<userToken>

<expires>1404462835243</expires>

<token>c38ac2af28060e1865c38c06c39c68c389c2bc27c2ac6858c38a1f0de280b0c396476fe280a03741485133e280b9c2a8</token>

<userId>user_id_here</userId>

<valid>true</valid>

</userToken>

Login to obtain a TOKEN that is valid for one hour
Check token validity

ITEM

VALUE

URL

http://<URL>/api/api/v1/login/token_here

METHOD

GET

HEADER

accept=application/xml

BODY

N/A

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<userToken>

    <expires>1404466320000</expires>

    <token> token_here </token>

    <userId>user_id_here</userId>

    <valid>true</valid>

</userToken>

Link for inline file download, using File ID

ITEM

VALUE

URL

http://<URL>/api/api/v1/file/token_here/link_by_id/file_id_here

METHOD

GET

HEADER

accept=application/xml

BODY

N/A

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<fileLink>

<id>file_id_here</id>  <downloadLink>documenta-dms.com/ws_download_file?token=c38bc3a9c2a9c2b60143c38e22c3b7c3afe280981402c3bfc390e280a17fc399c3b8c5b859c399efbfbde280a13c2715c2adc5bd4e345a</downloadLink>

</fileLink>

  • Returns a link used for downloading the file
Link for file inline download, base on file server path

Acest pas deschide un fisier din Documenta pe baza locatiei unde este salvat, fara a mai fi nevoie de logare.

Calea trebuie scrisa in BODY altfel nu ar putea fi interpretat datorita caracterelor ‘/’.

ITEM

VALUE

URL

http://<URL>/api/api/v1/file/token_here/link_by_path

METHOD

GET

HEADER

accept=application/xml

BODY

<fileLink>

<path>SITE\folder1\folder2\my_file.docx</path>

</fileLink>

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<fileLink>

    <id>file_id_here</id> <downloadLink>documenta-dms.com/ws_download_file?token=c3adc2b061c2a4c3b4c3883de280ba0cc3a34e0c2216e2809ce280ba2574c5935dc3bcc2b654c39d461a56e280a2c39044c3b3c395</downloadLink>

    <path> SITE\folder1\folder2\my_file.docx</path>

</fileLink>

Get File List from Folder ID

ITEM

VALUE

URL

http://<URL>/api/api/v1/dir/token_here/link_by_id/dir_id_here

METHOD

GET

HEADER

accept=application/xml

BODY

N/A

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<dirLink>

    <id>dir_id_here</id>

    <fileLinks>

        <id>file_1_id_here</id>

        <downloadLink>documenta-dms.com /ws_download_file?token=efbfbde2809c5dc2b6164052c2bb72c2a002c387c5b8e280a01875c3b5c5b8657c0724c2ac63397623763de2809969c385</downloadLink>

    </fileLinks>

    <fileLinks>

        <id>file_2_id_here</id>        <downloadLink>new.documenta.ro/ws_download_file?token=5d3577c2ab795bc2a9175561c3b856e280a23fe280a02ec3a53fc2b6c2bec5a1460477c2b2c3a80725721fc388c2b1</downloadLink>

    </fileLinks>

</dirLink>

Get File list from Folder Path

ITEM

VALUE

URL

http://<URL>/api/api/v1/dir/token_here/link_by_path

METHOD

POST

HEADER

accept=application/xml

BODY

<dirLink>

<path>SITE\folder1\folder2\</path>

</dirLink >

EXPECTED RESPONSE

<?xml version=”1.0″ encoding=”UTF-8″?>

<dirLink>

    <id>dir_id_here</id>

    <fileLinks>

        <id>file_1_id_here</id>

        <downloadLink>documenta-dms.com /ws_download_file?token=efbfbde2809c5dc2b6164052c2bb72c2a002c387c5b8e280a01875c3b5c5b8657c0724c2ac63397623763de2809969c385</downloadLink>

    </fileLinks>

    <fileLinks>

        <id>file_2_id_here</id>        <downloadLink>new.documenta.ro/ws_download_file?token=5d3577c2ab795bc2a9175561c3b856e280a23fe280a02ec3a53fc2b6c2bec5a1460477c2b2c3a80725721fc388c2b1</downloadLink>

    </fileLinks>

</dirLink>

Get Root Dir (folder) ID for current user

http://<URL>/api/api/v1/dir/{token}/get_root

Get folder name

http://<URL>//api/v1/dir/{token}/get_folder_name/{dirId}

Get ID Director by path

http://<URL>/api/v1/dir/{token}/get_dirid_by_path/{dirPath}

 

Returns DIR_ID and DIR_NAME

Parameter example: ‘SITE\ERP\4.Development\src\SQL\ERP UPD 1.1\PTM\’

 

This web service is using also “[“character as path delimiter.

Example: ‘SITE[ERP[4.Development[src[SQL[ERP UPD 1.1[PTM]

Get subfolders

http://<URL>/api/api/v1/dir/{token}/get_subfolders/{FolderID}

Get All Document Templates

http://<URL>/api/api/v1/ template/{token}/doc_template_list

Generate from template

http://<URL>/api/v1/template/{token}/gen_from_template/{templateId}/{folderId}

Get Ms WORD Document Templates

http://<URL>/api/api/v1/ template/{token}/doc_template_list_filter/WORD

Get Ms EXCEL Document Templates

http://<URL>/api/api/v1/ template/{token}/doc_template_list_filter/EXCEL

Get Document Category by File ID

http://<URL>/ api/v1/file/{token}/category_by_id/{fileId}

Get file metadata and values for metadata – only Label and Value

http://<URL>/api/api/v1/file/{token}/meta_by_id/{fileId}

Get users list

http:///api/v1/utilizator/{token}/get_list

Change user’s password

http://<URL>/api/v1/utilizator/{token}/change_password/{oldPassword}/{newPassword}

Change language

http://<URL>/api/v1/lang/{token}/change_language/{language}

Get file download link

http://<URL>/ api /api/v1/file/{token}/link_by_id/{fileId}

Upload File

http://<URL>/ api /api/v1/file/upload/

 

method = RequestMethod.POST, consumes = „multipart/form-data”, produces = {„application/xml”, „application/json”}

 

  • byte[] uploadData,
  • HttpServletRequest request,
  • @RequestParam(„token”) String token,
  • @RequestParam(„dirId”) Integer dirId,
  • @RequestParam(„userId”) Integer userId,
  • @RequestParam(„fileData”) MultipartFile fileData
File Check In

http://<URL>/ api /api/v1/file/checkIn/

 

@RequestMapping(value = „/api/v1/file/checkIn/”, method = RequestMethod.POST, consumes = „multipart/form-data”, produces = {„application/xml”, „application/json”})

 

  • byte[] uploadData,
  • HttpServletRequest request,
  • @RequestParam(„finishEdit”) Integer finishEdit,
  • @RequestParam(„fileId”) Integer fileId,
  • @RequestParam(„token”) String token,
  • @RequestParam(„userId”) Integer userId,
  • @RequestParam(„comment”) String comment
  • @RequestParam(„fileData”) MultipartFile fileData

 

Get Metadata for a Category ID

http://<URL>/api/ api/v1/attribute/{token}/ list_by_category/{categoryId}

Get File Metadata and Values – full metadata description plus value

http://<URL>/api/ api/v1/attribute/{token}/file_attr_list_by_id/{fileId}

Get File General Properties

http://<URL>/api/ api/v1/attribute/{token}/file_attr_general_by_id/{fileId}

Get File Security

http://<URL>/api/ api/v1/attribute/{token}/file_security_by_id/{fileId}

Set File Metadata Values

http://<URL>/api/ api/v1/attribute/{token}/set_attr_list/{fileId}

 

@RequestMapping(value = „/set_attr_list/{fileId}”, method = RequestMethod.PUT, consumes = {„application/xml”, „application/json”}, produces = {„application/xml”, „application/json”})

 

Parametrii sunt:

  • public BaseModel setDocAttributes(@PathVariable String token, @PathVariable Integer fileId, @RequestBody DocAttrLinkList docAttrLinkList)

 

Unde AttLinkList contine o lista XML de:

 

  • private Integer attributeId;
  • private String value;
  • private String label;
  • private String dataType;
  • private Integer length;
  • private Integer precision;
  • private Boolean mandatory;
  • private Integer selectionType;
  • private Integer lovId;
  • private Integer position;
  • private Boolean readOnly;
  • private Boolean hidden;
  • private Boolean multipleSelection.
Set Document Category

http://<URL>/api/ api/v1/attribute/{token}/set_document_category/{fileId}/{categoryId}

List all document classes

http://<URL>/api/v1/attribute/{token}/list_all_document_types/

 

  • Returns all document classes filtered by unit_id
List all document types

http://<URL>/api/v1/attribute/{token}/list_all_categories/

 

  • Returns all document categories
Get LOV available values

http://<URL>/api/ api/v1/lov/{token}/values_by_id/{LovId}

 

LOV ID is obtained from Category / Metadata

Get all lovs

http;//<URL>/api/v1/lov/{token}/get_all_lovs/

Get PDF Preview for file

http://<URL>/api/api/v1/file/token_here/pdf_by_id/file_id_here

 

  • Returns a link for inline download for PDF version of that document. If PDF Version is not available an error messaje will be shown.

For PDF and images – JPEG, Gif, Tiff, JPG – this web service call is not needed – the client will display directly the image/PDF.

Get Flows List

http://<URL>/api/api/v1/flow/{token}/get/{flowStatus}/{stepStatus}/{stepType}

 

Parameters:

  • flowStatus: A = active; F=Finalized
  • stepStatus: F=Finalized; W=Current step to the current user; P = Pending
  • stepType:
    • INFORMARE=Information
    • APROBARE=Approval
    • ATRIBUIRE=Allocated
    • RESPINS=Rejected
    • DELEGARE=Delegation of responsability
Get All Workflows for one Documenta unit

http://<URL>/api/v1/flow/{token}/list_all_workflows/

 

  • Returns all defined workflows on one Documenta unit
Get Compliant Workflows for FileId

http://<URL>/api/api/v1/flow/{token}/get/{fileId}/

Get Worflow Details

http://<URL>/api/api/v1/flow/{token}/get_details/{workflowId}/

Send File on Flow

http://<URL>/api/api/v1/flow/{token}/get/{fileId}/{flowId}/{info}/{userId}

Act on File on FLow

http://<URL>api/api/v1/flow/{token}/get/{fileId}/{flowId}/{comment}/{action}/{pas}/{idUser}

 

Where action=

  • YES 
  • NO
Get Flow Steps

http://<URL>/api/api/v1/flow/{token}/get_flow_steps/{fileId}/{flowId}/

Block File

http://<URL>/ api/v1/file/{token}/checkOut/{fileId}/{userId}

Get all user flows

http://<URL>/api/v1/flow/{token}/get/all_user_flows/

Get all registry for file ID

http://<URL>/api/v1/register/{token} /get_list_for_file/{fileId}

Returns all registry with access rights for parameter document type ID.

Filename by formula

http://<URL>/api/v1/file/{token}/filename_by_formula/{fileId}

  • Sets and returns filename after DMS label rules implementation according to document type
Search

http://<URL>/api/api/v1/file/{token}/search/{dirId}/{searchName}

  • <dirId> – Director’s ID that one is looking in
  • <searchName> -what is looking for
Create new folder

http://<URL> /api/v1/dir/{token}/create_dir/{ParentDirId}/{FolderName}

 

RETURNS:

  • Name (new folder name)
  • Id (new folder ID)

 

If error: ID=-1; Name wil contain ERROR CODE (error messages should be displayed from win.properties to the user) :

  • ERR_NO_VSS_CRE_DIR_ROLE
  • ERR_NO_WRITE_RIGHTS_ON_PARENT
  • ERR_FOLDER_ALREAD_EXISTS
Get flows for category

http://<URL>/api /api/v1/flow/{token}/get_flows_for_category/

Get flows for categoryID

http://<URL>/api/v1/flow/{token}/get_flows_for_category/{categoryId}

Check file exists

http://<URL>/api/v1/file/{token}/check_file_exists/{dirId}/{fileName}

 

Returns FileID with all data including filename– if the file exists.

Check in force

http://<URL>/api/v1/file/check_in_force/

 

Parameters (byte[] uploadData, HttpServletRequest request):

 

@RequestParam(„forceIfOtherUser”) Integer forceIfOtherUser,

@RequestParam(„fileId”) Integer fileId,

@RequestParam(„token”) String token, @RequestParam(„userId”) Integer userId, @RequestParam(„comment”) String comment,

@RequestParam(„fileData”) MultipartFile fileData) – similar cu /api/v1/file/checkIn/ sau upload

Add document category

http://<URL>/api/v1/attribute/{token}/add_document_category/{code}/{name}/{position}/

Returns new document category

Add document category with idFolder

http://<URL>/api/v1/attribute/{token}/add_document/{idTip}/{code}/{name}/{position}/{idFolder}/

List all master attributes

http://<URL>/api/v1/attribute/{token}/get_all_master_attributes/

Add attribute from master attributes

http://<URL>/api/v1/attribute/{token}/add_attribute_from_master/{p_id_document_to}/{p_id_master_atribute}/

Add new master attribute

http://<URL>/api/v1/attribute/{token}/add_new_master_attribute/{p_name}/{p_description}/{p_date_type}/{p_length}/{p_precision}/{p_mandatory}/{p_default_value}/{p_selection_type}

/{p_lov_id}/{p_position}/{p_formula_calcul}/{p_read_only}/{p_hidden}/{p_multiple_selection}/

All parameters with no value will be replaced with “+”

Delete attribute

http://<URL>/api/v1/attribute/{token}/delete/{attributeId}/{documentId}

Get file output format

http://<URL>/api/v1/file/{token}/get_file_output_version/{fileId}

Get document output format

http://<URL>/api/v1/file/{token}/get_document_output_format/{documentId}

Register file

http://<URL>/api/v1/file/{token}/register/{fileId}/{registerId}/{from}/{nrTert}/{dateProvider}/{source}/{to}/{description}

Get user’s registry list

http://<URL>/api/v1/register/{token}/get_user_list/

Returns all registry with access rights for current user.

Get registry list for document type

http://<URL>/api/v1/register/{token} /get_list_for_type/{documentTypeId}

Returns all registry with access rights for parameter document type ID.