page title decoration image

Retrieve active DMS documents for the specified client projects

GET /api/v2/clients/{client_id}/dms/documents

Retrieve active DMS documents for the specified client projects

Code samples

# You can also use wget
curl -X GET /api/v2/clients/{client_id}/dms/documents \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'
GET /api/v2/clients/{client_id}/dms/documents HTTP/1.1

Accept: application/json

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/api/v2/clients/{client_id}/dms/documents',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/api/v2/clients/{client_id}/dms/documents',
  params: {
  }, headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/api/v2/clients/{client_id}/dms/documents', headers = headers)

print(r.json())
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/v2/clients/{client_id}/dms/documents', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
URL obj = new URL("/api/v2/clients/{client_id}/dms/documents");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api/v2/clients/{client_id}/dms/documents", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/v2/clients/{client_id}/dms/documents

Returns a list of active DMS documents associated with the specified client projects that the user has permission to access.

Parameters

NameInTypeRequiredDescription
client_idpathintegertrueClient ID
project_idsquerystringfalseComma-separated list of numeric project IDs

Example responses

200 Response

{
  "status": "success",
  "code": 200,
  "message": "Document retrieved successfully",
  "details": [
    {
      "id": 42,
      "projectId": 5,
      "folderId": 42,
      "parentUuid": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Internal documents",
      "description": "Folder for internal documents",
      "fileSize": 512,
      "createdAt": "2022-12-01T08:30:00",
      "createdUserId": 7,
      "createdUserName": "John Doe"
    }
  ]
}

401 Response

{
  "status": "error",
  "code": 401,
  "message": "Authentication failed",
  "details": "JWT token not found"
}

403 Response

{
  "status": "error",
  "code": 403,
  "message": "Access denied",
  "details": "Insufficient permissions"
}

500 Response

{
  "status": "error",
  "code": 500,
  "message": "Internal server error",
  "details": "An internal server error occurred"
}

Responses

StatusMeaningDescriptionSchema
200OKDMS document listInline
401UnauthorizedAuthentication error (JWT token missing/invalid)ErrorResponse
403ForbiddenAccess denied (insufficient permissions)ErrorResponse
500Internal Server ErrorInternal server errorErrorResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» statusstringfalsenonenone
» codeintegerfalsenonenone
» messagestringfalsenonenone
» details[DmsDocumentItem]falsenonenone
»» idintegertruenoneUnique folder ID
»» projectIdintegertruenoneProject identifier
»» folderIdintegertruenoneParent DMS folder ID
»» parentUuidstring(uuid)truenoneParent task/subproject UUID
»» namestringtruenoneFolder name
»» descriptionstring¦nullfalsenoneFolder description
»» fileSizeintegerfalsenoneFile Size
»» createdAtstring(date-time)falsenoneCreation timestamp
»» createdUserIdintegerfalsenoneID of the creating user (-1 if unknown)
»» createdUserNamestringfalsenoneName of the creating user