### GET /api/v2/download-documents Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0#heading=h.ip4gdmty46kc Retrieves a list of documents available for download. ```APIDOC ## GET /api/v2/download-documents ### Description Fetches a list of documents that are ready for download based on current user permissions. ### Method GET ### Endpoint /api/v2/download-documents ### Response #### Success Response (200) - **documents** (array) - List of document objects. #### Response Example { "documents": [ {"id": "doc_123", "name": "Contract.pdf"} ] } ``` -------------------------------- ### GET /api/v2/documents/{document_id}/original Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0#heading=h.ip4gdmty46kc Retrieves the original file content of a specific document. ```APIDOC ## GET /api/v2/documents//original ### Description Downloads the original document file associated with the provided document ID. ### Method GET ### Endpoint /api/v2/documents//original ### Parameters #### Path Parameters - **document_id** (string) - Required - The unique identifier of the document. ### Response #### Success Response (200) - **file** (binary) - The original document file content. #### Response Example Binary stream of the document. ``` -------------------------------- ### GET /api/v2/documents/{document_id}/archive Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0#heading=h.ip4gdmty46kc Downloads a ZIP archive containing the document and its associated signatures. ```APIDOC ## GET /api/v2/documents//archive ### Description Downloads a ZIP archive containing the document and all attached digital signatures. ### Method GET ### Endpoint /api/v2/documents//archive ### Parameters #### Path Parameters - **document_id** (string) - Required - The unique identifier of the document. ### Response #### Success Response (200) - **archive** (binary) - ZIP archive file. #### Response Example Binary stream of the ZIP archive. ``` -------------------------------- ### User and Team Management Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0 APIs for managing users, teams, roles, and permissions within the Vchasno.EDO system. ```APIDOC ## POST /api/v2/users/invite ### Description Invites one or more new employees via email. ### Method POST ### Endpoint /api/v2/users/invite ### Parameters #### Request Body - **emails** (array of strings) - Required - A list of email addresses to invite. - **role_ids** (array of strings) - Optional - IDs of roles to assign to the invited users. ### Request Example { "emails": ["user1@example.com", "user2@example.com"], "role_ids": ["roleA", "roleB"] } ### Response #### Success Response (200) - Confirmation of invitation sent. #### Response Example { "message": "Invitations sent successfully." } ``` ```APIDOC ## GET /api/v2/users ### Description Retrieves a list of active employees and their role IDs. ### Method GET ### Endpoint /api/v2/users ### Response #### Success Response (200) - A list of active users and their role information. #### Response Example { "users": [ { "id": "user123", "email": "user1@example.com", "role_ids": ["roleA"] }, { "id": "user456", "email": "user2@example.com", "role_ids": ["roleB", "roleC"] } ] } ``` ```APIDOC ## DELETE /api/v2/users/{user_id} ### Description Deletes a user account. ### Method DELETE ### Endpoint /api/v2/users/{user_id} ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user to delete. ### Response #### Success Response (200) - Confirmation of user deletion. #### Response Example { "message": "User deleted successfully." } ``` ```APIDOC ## GET /api/v2/teams ### Description Retrieves a list of company teams. ### Method GET ### Endpoint /api/v2/teams ### Response #### Success Response (200) - A list of teams. #### Response Example { "teams": [ { "id": "team1", "name": "Sales Team" }, { "id": "team2", "name": "Support Team" } ] } ``` ```APIDOC ## POST /api/v2/teams ### Description Creates a new team. ### Method POST ### Endpoint /api/v2/teams ### Parameters #### Request Body - **name** (string) - Required - The name of the new team. ### Request Example { "name": "Marketing Team" } ### Response #### Success Response (200) - Confirmation of team creation. #### Response Example { "message": "Team created successfully.", "team_id": "team3" } ``` -------------------------------- ### Authentication and Authorization Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0 APIs related to user authentication, token management, and authorization. ```APIDOC ## POST /api/v2/auth/token ### Description Generates a user token. ### Method POST ### Endpoint /api/v2/auth/token ### Parameters #### Request Body - **username** (string) - Required - The user's username. - **password** (string) - Required - The user's password. ### Request Example { "username": "testuser", "password": "password123" } ### Response #### Success Response (200) - The generated user token. #### Response Example { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "bearer", "expires_in": 3600 } ``` ```APIDOC ## POST /api/v2/auth/refresh-token ### Description Refreshes an access token using a refresh token. ### Method POST ### Endpoint /api/v2/auth/refresh-token ### Parameters #### Request Body - **refresh_token** (string) - Required - The refresh token. ### Request Example { "refresh_token": "your_refresh_token_here" } ### Response #### Success Response (200) - A new access token. #### Response Example { "access_token": "new_access_token_here", "token_type": "bearer", "expires_in": 3600 } ``` -------------------------------- ### Structured Data and Labels Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0 APIs for managing structured data of documents and applying labels. ```APIDOC ## GET /api/v2/documents/{document_id}/structured-data ### Description Retrieves structured data for a document. ### Method GET ### Endpoint /api/v2/documents/{document_id}/structured-data ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. ### Response #### Success Response (200) - The structured data of the document. #### Response Example { "field1": "value1", "field2": "value2" } ``` ```APIDOC ## POST /api/v2/documents/{document_id}/labels ### Description Creates a new label and assigns it to a document. ### Method POST ### Endpoint /api/v2/documents/{document_id}/labels ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. #### Request Body - **label_name** (string) - Required - The name of the new label. ### Request Example { "label_name": "Urgent" } ### Response #### Success Response (200) - Confirmation of label creation and assignment. #### Response Example { "message": "Label 'Urgent' created and assigned to document." } ``` ```APIDOC ## POST /api/v2/documents/{document_id}/assign-label ### Description Assigns an existing label to a document. ### Method POST ### Endpoint /api/v2/documents/{document_id}/assign-label ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. #### Request Body - **label_id** (string) - Required - The ID of the existing label. ### Request Example { "label_id": "label789" } ### Response #### Success Response (200) - Confirmation of label assignment. #### Response Example { "message": "Label assigned to document successfully." } ``` ```APIDOC ## DELETE /api/v2/documents/{document_id}/labels/{label_id} ### Description Unlinks a label from a document. ### Method DELETE ### Endpoint /api/v2/documents/{document_id}/labels/{label_id} ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. - **label_id** (string) - Required - The ID of the label to unlink. ### Response #### Success Response (200) - Confirmation of label unlinking. #### Response Example { "message": "Label unlinked from document successfully." } ``` -------------------------------- ### Document Management APIs Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0 APIs for managing documents, including uploading, downloading, editing, and deleting documents and their associated data. ```APIDOC ## GET /api/v2/documents/{document_id}/original ### Description Downloads the original document file. ### Method GET ### Endpoint /api/v2/documents/{document_id}/original ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document to download. ### Response #### Success Response (200) - The original document file. #### Response Example (Binary file content) ``` ```APIDOC ## GET /api/v2/documents/{document_id}/archive ### Description Downloads a ZIP archive containing the document and its signatures. ### Method GET ### Endpoint /api/v2/documents/{document_id}/archive ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. ### Response #### Success Response (200) - A ZIP archive containing the document and signatures. #### Response Example (ZIP archive content) ``` ```APIDOC ## GET /api/v2/documents/{document_id}/p7s ### Description Downloads a P7S container with the document and signatures. ### Method GET ### Endpoint /api/v2/documents/{document_id}/p7s ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. ### Response #### Success Response (200) - A P7S container file. #### Response Example (P7S container content) ``` ```APIDOC ## GET /api/v2/download-documents ### Description Retrieves documents for download. ### Method GET ### Endpoint /api/v2/download-documents ### Parameters #### Query Parameters - **document_ids** (string) - Required - Comma-separated list of document IDs. ### Response #### Success Response (200) - A list of documents available for download. #### Response Example { "documents": [ { "id": "doc123", "name": "Document A" }, { "id": "doc456", "name": "Document B" } ] } ``` ```APIDOC ## GET /api/v2/documents/{document_id}/xml ### Description Downloads the PDF representation of an XML document. ### Method GET ### Endpoint /api/v2/documents/{document_id}/xml ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. ### Response #### Success Response (200) - The PDF representation of the XML document. #### Response Example (PDF content) ``` ```APIDOC ## GET /api/v2/documents/{document_id}/pdf ### Description Downloads the PDF representation of a document. ### Method GET ### Endpoint /api/v2/documents/{document_id}/pdf ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document. ### Response #### Success Response (200) - The PDF representation of the document. #### Response Example (PDF content) ``` ```APIDOC ## POST /api/v2/documents/statuses ### Description Gets statuses for a list of documents. ### Method POST ### Endpoint /api/v2/documents/statuses ### Parameters #### Request Body - **document_ids** (array of strings) - Required - A list of document IDs. ### Request Example { "document_ids": ["doc123", "doc456"] } ### Response #### Success Response (200) - A list of document statuses. #### Response Example { "statuses": [ { "id": "doc123", "status": "Processed" }, { "id": "doc456", "status": "Pending" } ] } ``` ```APIDOC ## DELETE /api/v2/documents/{document_id} ### Description Deletes a document. ### Method DELETE ### Endpoint /api/v2/documents/{document_id} ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document to delete. ### Response #### Success Response (200) - Confirmation of deletion. #### Response Example { "message": "Document deleted successfully." } ``` -------------------------------- ### Reporting and Auditing Source: https://docs.google.com/document/d/1yjDAensRbsY9-nujkKBPERyDG_LIAnrVzwE4Gfq0fzY/edit?tab=t.0 APIs for generating reports and accessing audit trails for document activities. ```APIDOC ## POST /api/v2/reports/document-history ### Description Requests a report of document activity history. ### Method POST ### Endpoint /api/v2/reports/document-history ### Parameters #### Request Body - **document_ids** (array of strings) - Optional - Filter by specific document IDs. - **start_date** (string) - Optional - Start date for the report (YYYY-MM-DD). - **end_date** (string) - Optional - End date for the report (YYYY-MM-DD). ### Request Example { "document_ids": ["doc123"], "start_date": "2023-01-01", "end_date": "2023-12-31" } ### Response #### Success Response (200) - Confirmation that the report generation has started. #### Response Example { "message": "Document history report generation started.", "report_id": "reportXYZ" } ``` ```APIDOC ## GET /api/v2/reports/{report_id}/status ### Description Checks the status of a report generation. ### Method GET ### Endpoint /api/v2/reports/{report_id}/status ### Parameters #### Path Parameters - **report_id** (string) - Required - The ID of the report. ### Response #### Success Response (200) - The status of the report generation. #### Response Example { "status": "Completed", "download_url": "/api/v2/reports/reportXYZ/download" } ``` ```APIDOC ## GET /api/v2/reports/{report_id}/download ### Description Downloads the generated report. ### Method GET ### Endpoint /api/v2/reports/{report_id}/download ### Parameters #### Path Parameters - **report_id** (string) - Required - The ID of the report. ### Response #### Success Response (200) - The generated report file. #### Response Example (Report file content) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.