Using contexts
API methods must be executed directly after the BI Point instance, e.g. http://localhost:55555/api/ReportContext/GetContextReports
Available methods:
api/ReportContext/GetContextReports
this method displays all reports to which the context has been assigned. It returns a list of objects containing the report ID, name, and a list of contexts. The returned list is in JSON format.
1. Request
this request accepts a list of contexts and a list of users. Both parameters are optional; if neither is specified, the response will contain a list of all context reports, unfiltered by access. Adding a context ID or its name will return reports assigned to those contexts. Adding a user ID or login will filter the list and return only those reports to which the user has access.
2. Response
this method returns a list of report objects grouped by users. Reports to which the user does not have access are not returned. Each report object contains an Id,ReportName, and a list of contexts (Id,Name,Caption) assigned to it.
api/ReportContext/GenerateLinks
this method generates a link to the report using the list of members, the report ID, and the context number. The report ID is the minimum parameter.
1. Request
the request accepts the report ID to be opened and a list of contexts. The list contains the context ID and a list of elements to be filtered. These elements may have Type and Value fields, which are limited to three supported types:
2. Unique name
3. Displayed name
4. OrgId
If BI Point cannot find an element, or if the provided context is not linked to the report, the report will open without the missing elements.
5. Response
this method generates a link to a report/dashboard with a GUID under which all information necessary for filtering is stored.
Examples of how to use the methods
api/ReportContext/GetContextReports
1.Requests
- all context reports are requested.
{"data":"{}"}
- context reports assigned to the context “Product” are requested.
{"data":"{\"Contexts\":[{\"Name\":\"Product\"}]}"}
- context reports assigned to the context with id 20 are requested.
{"data":"{\"Contexts\":\[{\"Id\":20}\]}"}
- context reports assigned to the context “Product” or to the context with id 20 are requested.
{"data":"{\"Contexts\":[{\"Id\":20},{\"Name\":\"Product\"}]}"}
- all context reports available to the user with login “ab” are queried.
{"data":"{\"Users\":[{\"Login\":\"ab\"}]}"}
- all context reports available to the user with id 14 are queried.
{"data":"{\"Users\":[{\"Id\":14}]}"}
- all context reports available to the user with the login ab and to the user with id 14 are queried. Reports are grouped separately for each user.
{"data":"{\"Users\":[{\"Login\":\"ab\"},{\"Id\":14}]}"}
- context reports assigned to the contect with id 20 and grouped by the user with the login “ab” and id 14 are queried.
{"data":"{\"Users\":[{\"Login\":\"ab\"},{\"Id\":14}],\"Contexts\":[{\"Id\":20}]}"}
2.Responses

api/ReportContext/GenerateLinks
1.Requests
- a link to the report 37530 is requested
{"data":"{\"Id\":37530}"}
- a link to the report 37530 filtered to the element with a unique name (Type 0) in the context with id 20 is requested
{"data":"{\"Id\":37530,\"Contexts\":[{\"Id\":20,\"Members\":[{\"Type\":0,\"Value\":\"[Product].[Code].&[100010013]\"}]}]}"}
- a link to the report 37530 filtered to the element with a displayed name (Type 1) in the context with id 20 is requested
{"data":"{\"Id\":37530,\"Contexts\":[{\"Id\":20,\"Members\":[{\"Type\":1,\"Value\":\"KAR/0024/OP\"}]}]}"}
- a link to the report 37530 filtered to the element with OrgId (Type 2) in the context with id 20 is requested
{"data":"{\"Id\":37530,\"Contexts\":[{\"Id\":20,\"Members\":[{\"Type\":2,\"Value\":\"368:141\"}]}]}"}
- a link to the report 37530 filtered to the element with a unique name, displayed name and OrgId in the context with id 20 is requested
{"data":"{\"Id\":37530,\"Contexts\":[{\"Id\":20,\"Members\":[{\"Type\":0,\"Value\":\"[Product].[Code].&[100010013]\"},{\"Type\":1,\"Value\":\"KAR/0024/OP\"},{\"Type\":2,\"Value\":\"368:141\"}]}]}"}
- a link to the report 37530 filtered to the element with a displayed name in the context with id 12 and with a unique name, displayed name and OrgId in the context with id 20 is requested
{"data":"{\"Id\":37530,\"Contexts\":[{\"Id\":12,\"Members\":[{\"Type\":1,\"Value\":\"00111 test test DE-123123 Bayern\"}]},{\"Id\":20,\"Members\":[{\"Type\":0,\"Value\":\"[Product].[Code].&[100010013]\"},{\"Type\":1,\"Value\":\"KAR/0024/OP\"},{\"Type\":2,\"Value\":\"368:141\"}]}]}"}
2.Responses
