documents API

Follow

Summary

Endpoint

/rest/workflow/job/{jobId}/documents?{args}

GET

Returns an array of job documents.

The endpoint accepts the following arguments in the call:

  • jobId - The ID of the job in Oneserve
  • includeThumbs - If =true then include thumbnails, else =false
  • pageNumber - The number of the page to be returned
  • pageSize the number of results to include in the page. If blank, returns all

Example URL

/workflow/job/59307/documents?includeThumbs=false&pageNumber=1&pageSize=1

Response Format Spec

 

Response Fields
Field Name Data Type Description
pagination JSON Object Pagination details
currentPage Integer The number of the result page
totalPages Integer The total number of pages
resultsPerPage Integer The number of result returned per page
totalResults Integer The total number of results returned
docs Array An array of document information
id Integer The ID of the document in Oneserve
title Text (100) The title of the document in Oneserve
description Text (MAX) The description of the file
created_date DateTime The date/time at which the file was uploaded
userId Integer The ID of the user who uploaded the document
userName Text (100) The first name + last name of the user
categoryId Integer The ID of the document category
categoryName Text (50) The name of the document category
filetype Text (50) The file type or extension of the document
filesize Integer The size of the file in KB
filename Text (300) The path to the file relative to the root store
thumbnail Text (MAX) The relative path to the item thumbnail

 

Available Response Representations

HTTP Code Description Schema
200 Document Information Document information
400 Bad Request Error
401 Unauthorized Error
403 Forbidden Error
404 Address Not Found Error
405 Method Not Allowed Error
500 Internal Server Error Error

 

Example Success Response
{
    "pagination": {
        "currentPage": 1,
        "totalPages": 2,
        "resultsPerPage": 2,
        "totalResults": 4
    },
    "docs": [
        {
            "id": 28193,
            "title": "Image for W01DDR",
            "description": "J023R6_42917_70c61d89-f452-4636-aeed-7c124bf4e4f8.jpg",
            "created_date": "2020-07-09T13:41:00Z",
            "userId": 1269,
            "userName": "Joe Bloggs",
            "categoryId": 21,
            "categoryName": "Photo",
            "filetype": "jpg",
            "filesize": 280625,
            "filename": "J/Photo/W01DDR_20200709144052_J023R6_42917_70c61d89-f452-4636-aeed-7c124bf4e4f8.jpg"
        },
        {
            "id": 28194,
            "title": "Image for W01DDR",
            "description": "J023R6_42917_70c61d89-f452-4636-aeed-7c124bf4e4f8.jpg",
            "created_date": "2020-07-09T13:41:00Z",
            "userId": 1269,
            "userName": "Joe Bloggs",
            "categoryId": 21,
            "categoryName": "Photo",
            "filetype": "jpg",
            "filesize": 280625,
            "filename": "J/Photo/W01DDR_20200709144052_J023R6_42917_70c61d89-f452-4636-aeed-7c124bf4e4f8.jpg"
        }
    ],
    "result": "success",
    "result_msg": ""
}

 

Troubleshooting

 

401 Unauthorized

Response

401 Unauthorized

Reason

This error occurs if the OS_REST_AUTH_TOKEN has not been provided, has expired, or does not exist in the system

Resolution

Verify your OS_REST_AUTH_TOKEN with support

403 Forbidden

Response

403 Forbidden

Reason

This error indicates that something is blocking your connection to the server

Resolution

Open a ticket with the support team with details of your connection so that your access can be verfied

404 Not Found

Response

404 Not Found

Reason

This error could occur if the endpoint is not entered correctly or a non-existent client ID is passed in the request

Resolution

Verify the endpoint matches the value specified in this article. Check that the client ID exists in your Oneserve system.

405 Method Not Allowed

Response

405 Method Not Allowed

Reason

This error will occur if an unacceptable method has been used in the call such as POST or DELETE

Resolution

Ensure that you are using a GET call to this endpoint

REST0000

Response

{
    "result": "fail",
    "result_msg": "REST0000",
    "result_error_msg": "Job with id 63134310 not found"
}

Reason

This error is returned when no jobs matching the provided ID and are found in the system

Resolution

Ensure that you are passing the correct details for the job in question in the call