<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rest api usage with Java in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56360#M1779</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11139"&gt;@iperezal﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Various resource on the Internet.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/" target="_self"&gt;RESTful Java client with java.net.URL&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://rest.elkstein.org/2008/02/using-rest-in-java.html" target="_self"&gt;Using REST in Java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://vaadin.com/blog/-/blogs/consuming-rest-services-from-java-applications" target="_self"&gt;Consuming REST services from Java applications&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could find more examples in &lt;A href="http://github.com" target="_self"&gt;Github&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 02:39:20 GMT</pubDate>
    <dc:creator>Eric_Zhang</dc:creator>
    <dc:date>2016-08-08T02:39:20Z</dc:date>
    <item>
      <title>Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/55920#M1762</link>
      <description>&lt;P&gt;There is any code example about how to use Rest api from Java?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 06:40:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/55920#M1762</guid>
      <dc:creator>iperezal</dc:creator>
      <dc:date>2016-08-05T06:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56360#M1779</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11139"&gt;@iperezal﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Various resource on the Internet.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/" target="_self"&gt;RESTful Java client with java.net.URL&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://rest.elkstein.org/2008/02/using-rest-in-java.html" target="_self"&gt;Using REST in Java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://vaadin.com/blog/-/blogs/consuming-rest-services-from-java-applications" target="_self"&gt;Consuming REST services from Java applications&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could find more examples in &lt;A href="http://github.com" target="_self"&gt;Github&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 02:39:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56360#M1779</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-08-08T02:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56381#M1781</link>
      <description>&lt;P&gt;But, there aren't any examples about PowerBI Rest API and his Auth in Java &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot authenticate from Java. I only can from C# and i need Java code&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 06:21:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56381#M1781</guid>
      <dc:creator>iperezal</dc:creator>
      <dc:date>2016-08-08T06:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56585#M1787</link>
      <description>&lt;P&gt;Azure AD has a Java library that you can use: &lt;A href="https://github.com/AzureAD/azure-activedirectory-library-for-java" target="_self"&gt;https://github.com/AzureAD/azure-activedirectory-library-for-java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 16:40:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/56585#M1787</guid>
      <dc:creator>jocaplan-MSFT</dc:creator>
      <dc:date>2016-08-08T16:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/58514#M1841</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/11139"&gt;@iperezal﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check this Github repository &lt;A href="https://github.com/satalyst/powerbi-rest-java" target="_self"&gt;satalyst/powerbi-rest-java&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The code snippet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;public class Office365Authenticator implements Authenticator {
    private static final String DEFAULT_AUTHORITY = "https://login.windows.net/common/oauth2/authorize";
    private static final String DEFAULT_POWER_BI_RESOURCE_ID = "https://analysis.windows.net/powerbi/api";
    private static final boolean DEFAULT_VALIDATE_AUTHORITY = false;
    private String authority = DEFAULT_AUTHORITY;
    private String powerBiResourceId = DEFAULT_POWER_BI_RESOURCE_ID;
    private boolean validateAuthority = DEFAULT_VALIDATE_AUTHORITY;
    private String nativeClientId;
    private String tenant;
    private String username;
    private String password;

    private ExecutorService executor;
    private ReadWriteLock tokenLock = new ReentrantReadWriteLock();
    private String cachedToken;

    private String _authenticate() throws AuthenticationFailureException {
        try {
            AuthenticationContext authenticationContext = new AuthenticationContext(
                    authority,
                    validateAuthority,
                    executor
            );

            String result = getAccessToken(
                    authenticationContext,
                    powerBiResourceId,
                    nativeClientId,
                    username + "@" + tenant,
                    password
            );

            if (StringUtils.isEmpty(result)) {
                throw new AuthenticationFailureException("Returned access token is null.");
            }

            return result;
        } catch (ExecutionException | InterruptedException | IOException e) {
            throw new AuthenticationFailureException(e);
        }
    }

    private String getAccessToken(AuthenticationContext authenticationContext, String resourceId, String clientId,
                                  String username, String password) throws ExecutionException, InterruptedException {
        return authenticationContext.acquireToken(
                resourceId,
                clientId,
                username,
                password,
                null
        ).get().getAccessToken();
    }
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 02:30:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/58514#M1841</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-08-15T02:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/177996#M5759</link>
      <description>&lt;P&gt;Hi....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any body give the java code for create dataset using power bi API...Advance in thanks...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gopinath M&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 10:54:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/177996#M5759</guid>
      <dc:creator>gopinath</dc:creator>
      <dc:date>2017-05-18T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/177999#M5760</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just created the API using above java code and I dont how to check the above mentioned maven project...&lt;/P&gt;&lt;P&gt;can you please provided step by step instructions to check the above API?I.e create dataset,add dataset..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gopinath Madhavan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 11:02:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/177999#M5760</guid>
      <dc:creator>gopinath</dc:creator>
      <dc:date>2017-05-18T11:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rest api usage with Java</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/475289#M14585</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;BR /&gt;In this code snippet&amp;nbsp; &lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;authority, validateAuthority, executor (authenticationContext )?&amp;nbsp;- How should i fill these values? what do they means ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;powerBiResourceId? - Where is this id , what does it means?&lt;BR /&gt;nativeClientId - I'm making a web app (not native app) and this will be ApplicationId in&amp;nbsp; Azure?&amp;nbsp;&lt;BR /&gt;username + "@" + tenant - I know this&lt;BR /&gt;password - I know this&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 13:19:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Rest-api-usage-with-Java/m-p/475289#M14585</guid>
      <dc:creator>d_u_a</dc:creator>
      <dc:date>2018-07-30T13:19:35Z</dc:date>
    </item>
  </channel>
</rss>

