BMugwe
(Boniface Mugwe)
5 June 2023 03:30
1
I am trying to use dataquery to fetch an SQL VIEW resource. The view has variables.
From the Web API, i am able to fetch the data like this:
http://localhost/api/29/sqlViews/lvWZykGDQHY/data?var=partner:Q6UQPyQFdHt
however i am unable to reconstruct the same using data query
{
"face": {
"resource": "sqlViews/lvWZykGDQHY/data",
"params": {
"paging": "false",
"filter": "partner:eq:Q6UQPyQFdHt"
}
}
}
{
"face": {
"resource": "sqlViews/lvWZykGDQHY/data",
"params": {
"paging": "false",
"var": "partner:eq:Q6UQPyQFdHt"
}
}
}
I have tried the two resource above without any success.
Kindly assist.
nnkogift
(Gift Nnko)
5 June 2023 07:23
2
Hello @BMugwe
I think the second one has a bit of an error. the var value should be partner:Q6UQPyQFdHt
instead of partner:eq:Q6UQPyQFdHt
. The eq
is for the filter
parameter.
BMugwe
(Boniface Mugwe)
5 June 2023 09:45
3
@nnkogift
Thanks for your response , it was really helpful.
What about when i want to have more than one variable.
/api/32/sqlViews/R6AgmtG6UBb/data?var=datasetid:Q6UQPyQFdHt&var=startdateid:2022-01-01&var=enddateid:2022-01-31
The resources is producing the correct api in console but its failing and returning a 409
nnkogift
(Gift Nnko)
7 June 2023 04:02
4
Perhaps you can try
{
"face": {
"resource": "sqlViews/R6AgmtG6UBb/data",
"params": {
"var": [
"datasetid:Q6UQPyQFdHt",
"startdateid:2022-01-01",
"enddateid:2022-01-31"
]
}
}
}
1 Like