<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay Polls, Microblogs &amp; Invitation API integration as web service</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111635548" />
  <subtitle>Liferay Polls, Microblogs &amp; Invitation API integration as web service</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111635548</id>
  <updated>2026-04-06T03:23:46Z</updated>
  <dc:date>2026-04-06T03:23:46Z</dc:date>
  <entry>
    <title>RE: Liferay Polls, Microblogs &amp; Invitation API integration as web service</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111820883" />
    <author>
      <name>dipesh bhavsar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111820883</id>
    <updated>2018-12-17T08:12:25Z</updated>
    <published>2018-12-17T08:12:25Z</published>
    <summary type="html">&lt;p&gt;Thanks Andrew for your quick response.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;We have followed the same approach and now able to fullfill our requirements.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks  a lot again.&lt;/p&gt;</summary>
    <dc:creator>dipesh bhavsar</dc:creator>
    <dc:date>2018-12-17T08:12:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Polls, Microblogs &amp; Invitation API integration as web service</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111640045" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111640045</id>
    <updated>2018-11-22T16:03:56Z</updated>
    <published>2018-11-22T16:03:56Z</published>
    <summary type="html">&lt;p&gt;Hi Dipesh,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The good news is that both those classes are just beans and you can
  actually build them yourself. For example, you can do  --&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
ServiceContext serviceContext = new ServiceContext();
serviceContext.setXXX();
...
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Looking at the code you provided, you only need the userId from the
  themeDisplay, and I think you should be able to get that from the
  request using the PortalUtil (really you should have a private member
  like this --)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
@Reference(ubind=&amp;quot;-&amp;quot;)
private Portal _portal;
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;.. and then use that to get the user id with the request --&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
long userId = _portal.getUserId(request);
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;.. to get the Login url, you can use this --&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;
String securePortalURL = PortalUtil.getPortalURL(request, secure);
String urlSignIn = securePortalURL.concat(mainPath).concat(&amp;quot;/portal/login&amp;quot;);
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;.. but all of this is based on the assumption that I understand what
  you are doing. IF you could post your code to show where it is not
  working for you, that would be the best approach as we could offer
  advice on how to alter exactly what you are working with.&lt;/p&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2018-11-22T16:03:56Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Polls, Microblogs &amp; Invitation API integration as web service</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111635547" />
    <author>
      <name>dipesh bhavsar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111635547</id>
    <updated>2018-11-22T09:22:40Z</updated>
    <published>2018-11-22T09:22:40Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are working on application using Liferay 7 DXP supported
  Colloboration and Social networking modules. We have backend
  application developed in Liferay and mobile applications in React Native.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We have used &lt;code&gt;com.liferay.polls.api&lt;/code&gt; ,&amp;nbsp; &lt;code&gt;com.liferay.invitation.invite.members.api.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are able to integrate these APIs inside liferay setup and can work
  from liferay portlets. But when the same APIs if we try to expose as
  REST API writting service layer for mobile application integration
  then we are not getting some of the parameter actionrequest shown in
  below sample and due to which our APIs are not working as a web service.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin-left: 40.0px;"&gt;ServiceContext &lt;b&gt;serviceContext &lt;/b&gt;= ServiceContextFactory.getInstance(&lt;b&gt;actionRequest&lt;/b&gt;);&lt;/p&gt;
&lt;p style="margin-left: 40.0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="margin-left: 40.0px;"&gt;serviceContext.setAttribute("loginURL", &lt;b&gt;themeDisplay.getURLSignIn(&lt;/b&gt;));&lt;/div&gt;
&lt;div style="margin-left: 40.0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="margin-left: 40.0px;"&gt;_memberRequestLocalService.addMemberRequests(&lt;/div&gt;
&lt;div style="margin-left: 40.0px;"&gt;themeDisplay.getUserId(), groupId,
  receiverUserIds, invitedRoleId,&lt;/div&gt;
&lt;div style="margin-left: 40.0px;"&gt;invitedTeamId, &lt;b&gt;serviceContext&lt;/b&gt;);&lt;/div&gt;
&lt;div style="margin-left: 40.0px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can any one pleae help us in this or guide us to solve this issue.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your help is appreciated !!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Dipesh Bhavsar&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>dipesh bhavsar</dc:creator>
    <dc:date>2018-11-22T09:22:40Z</dc:date>
  </entry>
</feed>
