on 2020 Oct 22 11:14 AM
Hi experts,
I have a problem:
I am trying to test the Analytical Reporting API and the ViewTemplates.
I have created the following ViewTemplate:
{
"viewTemplateName": "testTemplate8",
"type": "custom",
"status": "published",
"documentType": "SourcingProjectFact",
"selectAttributes": [
"ProjectId",
"BaselineSpend",
"ExecutionStrategy",
"TimeCreated",
"Region.Region",
"Organization.Organization",
"Commodity.Commodity",
"ProjectInfo",
"Currency"
],
"filterExpressions": [
{
"name": "myProjId",
"field": "ProjectId",
"op": "=",
"defaultValue": null
}
]
}
The template is working with the default value when I call it:
https://eu.openapi.ariba.com/api/analytics-reporting-view/v1/prod/views/testTemplate8?realm={myRealm...
It shows all possible entries as it should.
Now I want to overwrite the default value in my request:
https://eu.openapi.ariba.com/api/analytics-reporting-view/v1/prod/views/testTemplate8?realm={myRealm...;
This request is leading to an Error-response:
{
"code": "invalidFilterStructure",
"message": "Invalid filter structure. null"
}
Please help me to fix the problem.
Request clarification before answering.
Hi TB,
Can you please put {} around your filter? filters={"myProjId":"WS302297384"} and let us know if this works for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
tim92, following on sean.mcgann3's advice.... it is possible that you might also need to escape the curly brackets, see example below.
{ -> %7B
} -> %7D
" -> %22
Postman:
curl command:
curl --location --request GET 'https://openapi.ariba.com/api/analytics-reporting-view/v1/prod/views/S4ApprovalFlowFactSystemView?realm=myrealm-T&filters=%7B%22updatedDateFrom%22:%222020-09-01T00:00:00Z%22,%22updatedDateTo%22:%222020-11-22T00:00:00Z%22%7D' \
--header 'apiKey: [YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]'
Thank you for your input sean.mcgann3 & ajmaradiaga . This solved the problem. It seems that it is it mandatory to escape the special characters as Antonio suggested.
I also found out that you can request more than one ProjectID if the FilterExpressions are defined with the "IN" operator in the view-template. Then the syntax for the reqest would be: &filters=%7B"myProjId":%5B"<ID1>","<ID2>"%5D%7D
Maybe that could help someone else having trouble with it.
Best regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.