Question
John Deere
US
Last activity: 14 Aug 2023 11:06 EDT
Passing the parameter as JSON string to DXAPI application/v2/data_views
We are trying to use application/v2/data_views DXAPI for one of our application needs. Tried the run the data page from DXAPI swagger passing a Data page name for data_view_id and a string for dataViewParameters. Also tried few below values for dataViewParameters:
1. {"Param1":"XXXX"}
2. {"XXXX"}
3. "XXXX"
Can someone please share or let me know how to pass the parameter (dataviewparameter) value as JSON string for this API.
The below response is the response from API:
{ "errorClassification": "Invalid inputs", "localizedValue": "One or more inputs are invalid", "errorDetails": [ { "message": "Error_Malformed_Query_Param", "erroneousInputOutputFieldInPage": "", "erroneousInputOutputIdentifier": "", "errorClassification": "", "localizedValue": "dataViewParameters is not a valid JSON string.", "messageParameters": [] } ] }
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accenture
SG
@DilipA86 Below is the format to send dataViewParameters param value as Json.
@DilipA86 Below is the format to send dataViewParameters param value as Json.
{
"dataViewParameters": {
"additionalProp1": {}
},
"paging": {
"dataViewParameters": {
"additionalProp1": {}
},
"query": {
"aggregationsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"calculationsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"distinctResultsOnly": true,
"select": [
{
"dataViewParameters": {
"additionalProp1": {}
}
}
],
"sortBy": [
{
"dataViewParameters": {
"additionalProp1": {}
}
}
],
"filter": {
"filterConditionsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"logic": "string"
}
}
},
"query": {
"aggregationsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"calculationsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"distinctResultsOnly": true,
"select": [
{
"dataViewParameters": {
"additionalProp1": {}
}
}
],
"sortBy": [
{
"dataViewParameters": {
"additionalProp1": {}
}
}
],
"filter": {
"filterConditionsInternal": {
"additionalProp1": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp2": {
"dataViewParameters": {
"additionalProp1": {}
}
},
"additionalProp3": {
"dataViewParameters": {
"additionalProp1": {}
}
}
},
"logic": "string"
}
}
}
Accenture
SG
There is clear explanation about each API in Pega APIs. Please explore for better understanding.
John Deere
US
@VinayKumarL16594575 Thanks for the above response.
I have the above json structure and even I tried to pass subset (required elements) of the above json structure in Postman body. I can see the json captured as requestParameter but not mapped to dataViewParameters but with success response. And if its passed in Parameters of Postman it returns error.
And when we run the API from API Swagger space passing the same or subset of it in dataViewParameters, I received the below error message.
Error received:
The server recognized the request as invalid or malformed.
If you have run the API from PEGA API swagger space, can you please share the screen shots of it?
Thanks,
Dilip
Updated: 1 Aug 2023 0:46 EDT
Accenture
SG
I tested v2/data_views/{data_view_ID} using GET method.
dataViewParameters : ex: { "pyGUID": "834fa90e-5caf-4037-ba3e-9ecc22e8ef24" }
Please find the attached screenshots for your reference.
Note: You must need to update Application service package with your applications's accessgroup to access your application's data views
Thanks,
Vinay
John Deere
US
I have earlier used the same json structure for dataViewParameters earlier.
I tried again still getting the same error, attached screen1.
But, when tried with another application rule (having same roles) , then I am getting the error attached screen2.
Please let me know if you have any suggestions.
Updated: 2 Aug 2023 2:17 EDT
Accenture
SG
Don't pass the same Json which I have shared that is sample Json I have used for my testing. Form your own Json depending on your data page parameters and try.
Example : If you have a data page named "D_EmployeeDetails" with a parameter called "EmployeeID," your JSON would look like this:
dataViewParameters : { "EmployeeID": "1" }
Thanks,
Vinay
John Deere
US
Hi Vinay, I have the parameter in same structure and I am using pyGUID in the parameter.
The issue found, is the Data page scope has to be thread instead of Requestor. After that change, I am able to see desired output.
Thanks for responding.
-
Vinay Kumar Lingammagari Shubham Grover