= Bonita Portal URLs
:description: This page explains how to use a URL to access Bonita Portal or the form for a specific process or task.

This page explains how to use a URL to access Bonita Portal or the form for a specific process or task.

[NOTE]
====

In these URLs, the process names, versions and the task names must be URL encoded.
====

== URL of Bonita Portal

You can connect to Bonita Portal from other tools using a URL of the form `http://__host__:__port__/bonita#?...` . Other forms of URL are liable to change in future versions. For example, use `+http://localhost:8081/bonita#?process=myProcessId+`, and do not use `+http://localhost:8081/bonita/console/homepage#?process=myProcessId+`.

== Process instantiation URL

The following code samples show how to generate a link to a process instantiation form.

=== Complete URL

This sample shows how to construct the complete URL. Prefer the short format for backward compatibility.

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/resource/process/%s/%s/content/?id=%s\">Here</a>", host, port, processName, processVersion, processDefinitionId);
----

Example: +
`+http://localhost:8080/bonita/portal/resource/process/Task%20link%20via%20email/1.0/content/?id=34951576542454+`

=== Short URL

This sample shows how to construct the short URL. Prefer this format for backward compatibility. You will automatically be redirected to the complete format.

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/form/process/%s/%s\">Here</a>", host, port, processName, processVersion);
----

Example: +
`+http://localhost:8080/bonita/portal/form/process/Task%20link%20via%20email/1.0+`

== Process overview URL

The following code samples show how to generate a link to a process overview form.

=== Complete URL

This sample shows how to construct the complete URL. Prefer the short format for backward compatibility.

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/resource/processInstance/%s/%s/content/?id=%s\">Here</a>", host, port, processName, processVersion, processInstanceId);
----

Example: +
`+http://localhost:8080/bonita/portal/resource/processInstance/Task%20link%20via%20email/1.0/content/?id=8+`

=== Short URL

This sample shows how to construct the short URL. Prefer this format for backward compatibility. You will automatically be redirected to the complete format.

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/form/processInstance/%s\">Here</a>", host, port, processInstanceId);
----

Example: +
`+http://localhost:8080/bonita/portal/form/processInstance/8+`

== Task URL

[IMPORTANT]
====
A task is not automatically assigned to the user who accesses the task form. There must first be a {openApiUrl}/{openApiLatestVersion}/#tag/BPM[REST API call to assign the task to the user].
Otherwise, the user will not be able to execute the task.
====

The following code samples show how to generate a link to a human task.

=== Complete URL

This sample shows how to construct the complete URL. Prefer the short format for backward compatibility.

[source,java]
----
 String.format("URL: <a href=\"http://%s:%s/bonita/portal/resource/taskInstance/%s/%s/%s/content/?id=%s\">Here</a>", host, port, processName, processVersion, activityName, activityInstanceId);
----

Example: +
`+http://localhost:8080/bonita/portal/resource/taskInstance/Task%20link%20via%20email/1.0/Task/content/?id=3+`

=== Short URL

This sample shows how to construct the short URL. Prefer this format for backward compatibility. You will automatically be redirected to the complete format.

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/form/taskInstance/%s\">Here</a>", host, port, activityInstanceId);
----

Example: +
`+http://localhost:8080/bonita/portal/form/taskInstance/3+`

Or if you only have the process instance ID and the task name:

[source,java]
----
String.format("URL: <a href=\"http://%s:%s/bonita/portal/form/processInstance/%s/task/%s\">Here</a>", host, port, processInstanceId, taskName);
----

Example: +
`+http://localhost:8080/bonita/portal/form/processInstance/8/task/request%20approval+`

With the above format, the first task with the name "request approval" available for the user found in the process instance with id 8 will be displayed.

== URL parameter summary

|===
| Parameter | Description | Example

| `locale=<string>`
| Optional. Identifies the language to be used.
| `locale=en`

| `id=<id>`
a|
* For process instantiation URL, identifies the process definition id.
* For process overview URL, identifies the process instance id.
* For task URL, identifies the activity instance of the task.
| `id=6972973247608922361`

| `user=<userId>`
| Optional. Identifies the user you perform the task for (for administrators and process managers).
| `user=201`

| `tenant=<tenantId>`
| Optional. Identifies the tenant on which the process is deployed for multiple tenants environments (Multi-tenancy is available with the Enterprise and Performance editions only).
| `tenant=2`
|===
