Search code examples
business-intelligencebusiness-objects

/raylight/v1/documents/id/parameters/ does not return all parameters


I am using this api to get all prompt parameters (v4.2 sp3). When the document does not contain any context parameters API returns all parameters as expected. However if there is some context parameter API returns only context parameters...

Example: Document id = 1 does not contain context parameter

GET /raylight/v1/documents/1/parameters/

I get something like

<parameters>
    <parameter optional="false" type="prompt" dpId="DP0">
        <id>0</id>
        ...
    <parameter>
    <parameter optional="false" type="prompt" dpId="DP0">
        <id>1</id>
        ...
    <parameter>
</parameters>

The same Document id = 2 but with context parameter

GET /raylight/v1/documents/2/parameters/

I get something like

<parameters>
    <parameter optional="false" type="context" dpId="DP0">
        <id>0</id>
        ...
    <parameter>
</parameters>

There are no other 2 parameters... However they are available directly

GET /raylight/v1/documents/2/parameters/1

returns

<parameter optional="false" type="prompt" dpId="DP0">
    <id>1</id>
    ...
<parameter>

GET /raylight/v1/documents/2/parameters/2

returns

<parameter optional="false" type="prompt" dpId="DP0">
    <id>2</id>
    ...
<parameter>

GET /raylight/v1/documents/2/parameters/3 returns http 404.

How can I get all parameters or at least parameters' count?


Solution

  • If there is a Context, it is not possible to have the full list of parameters. You first need to reply to the Context parameters, so that Web Intelligence is able to build the list of standard prompts.

    In fact Prompts depends on the Context(s), this is the reason why you need to disambiguate them before obtaining a complete list of parameters.