The chat responses are generated using Generative AI technology for intuitive search and may not be entirely accurate. They are not intended as professional advice. For full details, including our use rights, privacy practices and potential export control restrictions, please refer to our Generative AI Service Privacy Information. As this is a test version, please let us know if something irritating comes up. Like you get recommended a chocolate fudge ice cream instead of an energy managing application. If that occurs, please use the feedback button in our contact form!
Skip to content

REST API or your own endpoints?

2612

A view reaches Polarion data in two ways. Both are authenticated with the same token from the context, both run as the logged-in user, and most applications use both. This page helps you decide which one to use for a given task; the SDK (context and events) is the third channel and is covered in How an application works.

Side by side

Polarion REST APIYour own endpoints
What it isPolarion's documented API, JSON:API style, under /polarion/rest/v1HTTP endpoints under /polarion/apps/<identifier>/rest/, implemented by your JavaScript on the server
Code to writeOnly in the viewScript on the server plus the call in the view
CoversProjects, work items, documents, test runs, plans, users, enumerations, …Anything the Polarion Java API can do, plus external systems
Request shapeFixed by the API (sparse fields, includes, pagination)Defined by you
Work per requestOne resource or one listUnlimited (within reason)
Runs asThe userThe user
Deployed withNothing extraThe application package
DocumentationREST API User Guide, OpenAPI definition on the serverYour README and TypeScript types

Use the REST API when…

  • the data is a single object or a list the API offers directly;
  • the operation is a standard create, update, link or comment;
  • you want zero server-side code, for example in a prototype or a purely presentational view.

See Calling the REST API from a view and the Cookbook.

Write an endpoint when…

  • the view would need many requests to assemble its data (trees, cross-project views, per-item computations);
  • the logic is a rule or validation that should live in one place and run on the server;
  • you need an API that REST does not expose (a utility, a service, history details);
  • the operation involves external systems and secrets;
  • you want a contract tailored to the UI rather than JSON:API documents;
  • the work is heavy and should not run in the browser.

See Your own REST endpoints and Patterns.

Typical split in an application

TaskChannel
Show the open work item's fieldsREST API
Show its full link tree with status of each nodeEndpoint
Rename, set a field, add a commentREST API
Validate the selected items against project rulesEndpoint
Assign all items with a finding to the current userEndpoint (one call, one result) or REST API (one PATCH per item)
Dashboard counts by status, type, assigneeREST API for small projects, endpoint for large ones
Notify a chat channelEndpoint

What is not available in 2612

  • No channel from the view back into the host UI: a view cannot refresh the form, open another work item or show a Polarion notification. Navigate with target="_top" links.
  • No events other than selection-changed.
  • No server push: views poll if they need to observe changes made by others.

These are preview limitations; see Limitations and known issues.