# How to access the API from a Tomcat application on the same tomcat as the Portal application ?

**URL:** https://community.ofelia.com/t/how-to-access-the-api-from-a-tomcat-application-on-the-same-tomcat-as-the-portal-application/6298
**Category:** Q&A
**Created:** [13 August 2015 10:17 UTC](https://community.ofelia.com/t/how-to-access-the-api-from-a-tomcat-application-on-the-same-tomcat-as-the-portal-application/6298 "2015-08-13T10:17:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michel.rv](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@michel.rv](https://community.ofelia.com/u/michel.rv)
#### Post date: [13 August 2015 10:17 UTC](https://community.ofelia.com/t/how-to-access-the-api-from-a-tomcat-application-on-the-same-tomcat-as-the-portal-application/6298/1 "2015-08-13T10:17:08Z")

</div>

Hello,

I have a Tomcat application that needs to (sometimes) access a Bonita process through the API (start one instance or send a message).

I decided to use the HTTP API. It works well if I connect to the engine managed by the Studio for example.

But I want to deploy my application on the same server as Bonita portal.

Problem: both applications share the same system properties, including “bonita.home”. Thus I cannot have two different bonita homes in my Tomcat, one for the portal (using the LOCAL API) and one for my application(s) using the HTTP API.

What can I do ?

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)
#### Post date: [14 August 2015 08:05 UTC](https://community.ofelia.com/t/how-to-access-the-api-from-a-tomcat-application-on-the-same-tomcat-as-the-portal-application/6298/2 "2015-08-14T08:05:59Z")

</div>

Hi,

In your application, as you use only the client side of Bonita Engine, you can define the API type programmatically without setting the bonita.home system property:  
  
Map\<String, String\> apiTypeParams = new HashMap\<\>();  
apiTypeParams.put(“server.url”, “[http://localhost:8080](http://localhost:8080)”);  
apiTypeParams.put(“application.name”, “bonita”);

```
    APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, apiTypeParams);

    LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();

```

---

<div class="post-metadata">

### Author: ![michel.rv](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@michel.rv](https://community.ofelia.com/u/michel.rv)
#### Post date: [14 August 2015 09:10 UTC](https://community.ofelia.com/t/how-to-access-the-api-from-a-tomcat-application-on-the-same-tomcat-as-the-portal-application/6298/3 "2015-08-14T09:10:01Z")

</div>

Hello,

Great, thank you !!!

Michel
