Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Not applicable

Howto set NPrining report filters trough REST Api?

Hi,

I try to get report from NPrinting. I send POST OnDemandRequest and then get it by GET-call OnDemandRequestResult.

Another task, I need to filter my report by some values (eg - quarter, year etc.). I try send PUT Filter request but get error - 400 with a message "Request is malformed". What I'm doing wrong?

This is JSON of the PUT-filter request:

{

  "id": "6c567bc4-1378-44c2-de4e-ff45673df23c",

  "enabled": "True",

  "fields": [{

  "name": "flag",

  "overrideValues": "True",

  "values": []

  }, {

  "name": "Test",

  "overrideValues": "True",

  "values": [{

  "value": "3",

  "type": "number"

  }, {

  "value": "4",

  "type": "number"

  }

  ]

  }

  ]

}

3 Replies
shneior2
New Contributor II

Re: Howto set NPrining report filters trough REST Api?

{

"appId": "e278ee9a-8985-46da-9aa8-75c2474a4cb1",

"enabled":"True",

"name": "NEW_FILTER",

"fields": [

{

"connectionId": "cd9207ef-0eb9-4124-81b7-35f6913ed03c",

"name": "FILED_TO_FILTER",

"overrideValues": "false",

                        "values": [

                            {

                                "value": "1",

                                "type": "number"

                            }

                        ]

}

]

}

Lech_Miszkiewicz
Honored Contributor III

Re: Howto set NPrining report filters trough REST Api?

This is very interesting - does it mean that filter has to exist in first place before you can apply it?

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
shneior2
New Contributor II

Re: Howto set NPrining report filters trough REST Api?

There is no meaning to the order of the field they just must to be there

for exemple you can write as follow

{

"appId": "e278ee9a-8985-46da-9aa8-75c2474a4cb1",

"enabled":"True",

"name": "NEW_FILTER",

"fields": [

{

"name": "FILED_TO_FILTER",

"overrideValues": "false",

                        "values": [

                            {

                                "value": "1",

                                "type": "number"

                            }

                        ],

"connectionId": "cd9207ef-0eb9-4124-81b7-35f6913ed03c"

}

]

}

note: that json add a new filter and you need to apply it on app/report/contact

Community Browser