JSFiddle - React, Tailwind, and code Playground
HTML
Exception in thread "main" com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:180)
at com.cpt.linkedin.linkedINExample.authorize(linkedINExample.java:57)
at com.cpt.linkedin.linkedINExample.main(linkedINExample.java:38)
Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:172)
... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.linkedin.com/uas/oauth/requestToken
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1458)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1452)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106)
at...
JavaScript
package com.cpt.linkedin;
import java.io.*;
import java.util.EnumMap;
import java.util.Map;
import com.google.code.linkedinapi.client.LinkedInApiClient;
import com.google.code.linkedinapi.client.LinkedInApiClientFactory;
import com.google.code.linkedinapi.client.enumeration.SearchParameter;
import com.google.code.linkedinapi.client.oauth.LinkedInAccessToken;
import com.google.code.linkedinapi.client.oauth.LinkedInOAuthService;
import com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceFactory;
import com.google.code.linkedinapi.client.oauth.LinkedInRequestToken;
import com.google.code.linkedinapi.schema.Connections;
import com.google.code.linkedinapi.schema.Network;
import com.google.code.linkedinapi.schema.People;
import com.google.code.linkedinapi.schema.Person;
import com.google.code.linkedinapi.schema.Update;
import com.google.code.linkedinapi.schema.UpdateComment;
public class linkedIN {
private static String consumerKeyValue="n5ze0x4mpv5";
private static String consumerSecretValue="c1xIcoTbsPJF69l";
private static String accessTokenValue="b1068b48-cdc0-4a7e-8b98-f20ebf23498";
private static String tokenSecretValue="90f43a1d-3bb7-456e-8b17-0666ec0cc39";
static LinkedInApiClientFactory factory;
static LinkedInApiClient client;
static LinkedInOAuthService oAuthService;
static LinkedInRequestToken request;
static String authURL;
private static LinkedInAccessToken accessToken;
public static void main(String[]args) throws IOException{
authorize(consumerKeyValue, consumerSecretValue);
createClient(consumerKeyValue, consumerSecretValue, accessTokenValue, tokenSecretValue);
getCurrentProfile();
getConnections();
getNetworkUpdates();
getSearch();
}
//Create a client
public static void createClient(String key, String secret, String token, String secretToken){
factory=LinkedInApiClientFactory.newInstance(key,secret);
client=factory.createLinkedInApiClient(accessToken);
System.out.println("Client Has...