Get UDR Data

POST /ws/rest/service/v2/udrdata

Available: 25.10 and later

Purpose

To retrieve User Defined Report data for a selected report at the shell level or company level.

Prerequisites

Ensure the following:

  • You have the required integration permissions to use this REST service.
  • To fetch shell level UDR data, shell and report exists.
  • To fetch company level UDR data, report exists.

Request Format

Send a request as a JSON map with the following structure:

{

"project_number": "<value>",

"reportname": "<value>",

"query": [

{

"label": "<Label Name>",

"value1": "<value>"

}

]

}

Request Parameters

Note:

The query parameter format for v2 is the same as that used for v1. For more information on v1, see User Defined Report (UDR).

Specify the following parameters in the Options JSON map:

Request Parameter Required? Data Type Description
project_number No String

A unique alphanumeric ID to identify the project. For example, "B-0001".

If the project number is not specified, the company-level UDR is retrieved.

reportname Yes String The name of the user-defined report.

Response Format

A JSON object is returned in the following format:

{

"data": [],

"message": [<list of messages>],

"status": <REST status code value>,

"rest_audit_id": <id from the audit table>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Success Request at the Project or Shell Level

Send a request for a UDR report at the project or shell level in the following format:

{

"project_number" : "PRJ201",

"reportname": "Contract",

"query": [

{

"label" : "Title",

"value1" : "Contract for garage doors"

}

]

}

Sample Success Response at the Project or Shell Level

A successful response with status code 200 displays in the following format:

{

"data": [

{

"report_data":

[

{

"Record No.": "CON-00002",

"Title": "Construction Contract",

"Status": "Approved",

"Amount": "348320.0"

},

{

"Record No.": "CON-00001",

"Title": "Design Contract",

"Status": "Approved",

"Amount": "55980.0"

},

{

"Record No.": "CON-00004",

"Title": "Furnishings Contract 2",

"Status":"Approved",

"Amount":"267981.0"

}

],

"report_datadefinition":

{

"Record No." : "java.lang.String",

"Title" : "java.lang.String",

"Status" :"java.lang.String",

"Amount" : "java.lang.Double"

}

}

],

"message": ["OK"],

"status": 200,

"rest_audit_id": 41

}

Sample Success Request at the Company Level

Send a request for a UDR report at the company level in the following format:

{

"reportname": "Contract",

"query": [

{

"Title" : "Contract for garage doors"

}

]

}

Sample Success Response at Company Level

A successful response with status code 200 displays in the following format:

{

"data": [

{

"report_data":

[

{

"Record No.": "CON-00002",

"Title": "Construction Contract",

"Status": "Approved",

"Amount": "348320.0"

},

{

"Record No.": "CON-00001",

"Title": "Design Contract",

"Status": "Approved",

"Amount": "55980.0"

},

{

"Record No.": "CON-00004",

"Title": "Furnishings Contract 2",

"Status":"Approved",

"Amount":"267981.0"

}

],

"report_datadefinition":

{

"Record No." : "java.lang.String"

"Title" : "java.lang.String"

"Status" :"java.lang.String"

"Amount" : "java.lang.Double"

}

}

],

"message": [ "OK" ],

"status": 200,

"rest_audit_id": 41

}

Supported Validation Messages and Status Codes

The following validation messages and status codes display in the response when incorrect values are provided in the request:

Field Name Use-case Scenario Status Code Error Message
project_number Specified project number does not exist 602 Project/Shell Number is not correct.
reportname Report does not exist 709 Report name is not valid. Check if report exists or is enabled for integration.
reportname Report exists but not enabled for integration 709 Report name is not valid. Check if report exists or is enabled for integration.