Could not connect to api.linkedin.com using HTTP CONNTECTOR

While I am trying to extract data from Linkedin portal I am getting OAUTH error where as my Keys are working perfectly when I test the same on the Linkedin Portal Testing Tools.

Could not connect to api.linkedin.com

Reason:

server returned HTTP response code: 401 for URL:
https://api.linkedin.com/v1/people/~/network/updates

Please help me on extracting data from the Linkedin.

Hi krsna007,

Did you check response content when 401 is received? Maybe there may be explanation of problem. I that does not help, could you please share your graph with us? Please remove all credentials.

Also, there is blog post with sample attached. Did you check it?

I hope this helps.

Hi kubosj,

Thanks for your reply. I’ve taken the example graph which you have mentioned but same issue. I feel some configuration I am missing. Please help me on this.

-----Graph Source ------------

<?xml version="1.0" encoding="UTF-8"?> <!\[CDATA\[ \]\]>

Hi krsna007,

Thanks for the graph. There are a few points in your graph that I’d like to go through:

  • The graph from the blog article is designed in version 3.5, and will not work in version 3.4 due to missing attributes on HTTPConnector component (for more information, see ticket CLO-868). If you do want to use earlier version anyway, you should use a workaround described in mentioned ticket.

  • Attribute „Store HTTP response to file“ is turned on in your graph, but if you want to consume this file by XMLExtract, you should use a different Processing type in „File URL“ attribute‘s dialog. Basically you have two options. First, turn off „Store HTTP response to file“ attribute, or use „source“ processing type.

  • Regarding the processing type, you shouldn’t use „stream“ processing type, since contcatenated input records wouldn’t form a valid XML file. Instead, you should use „discrete“ type that takes each record/field as a separate source. For more information about processing type, please refer to our article Input port reading in our documentation.

Hope this helps!

Hi,

I’ve installed 3.5.3 version tool & try to run the graph from clover examples. Still it is showing up the same connectivity issue.

  1. Is this something related to proxy setting in my organization? When I try to run “http://api.linkedin.com/v1/people/~/network/updates” this from URL I am getting message “Unknown authentication scheme”.

  2. Linkedin is providing OAuth 1.0a token key - Is this compatible with Clover 3.5 or do we need to get OAUTH 2.0 token keys.

I am copying the code here …please help me out resolve the connectivity issue…

---------------Source-------------------------

<?xml version="1.0" encoding="UTF-8"?> <!\[CDATA\[ \]\]> \--------------------------------------LOG----------------------

INFO [main] - *** CloverETL framework/transformation graph, (c) 2002-2014 Javlin a.s. ***
INFO [main] - Running with CloverETL library version 3.5.3 build#014 compiled 09/12/2014 03:52:48
INFO [main] - Running on 4 CPU(s), OS Windows 7, architecture amd64, Java version 1.7.0_07, max available memory for JVM 1845952 KB
INFO [main] - Loading default properties from: defaultProperties
INFO [main] - Engine plug-ins loaded: com.opensys.clover.lotusdomino, com.opensys.cloveretl.ctlfunction, com.opensys.clover.lookup, org.jetel.lookup, com.opensys.clover.component, org.jetel.bulkloader, org.jetel.license, org.jetel.tlfunction, com.opensys.cloveretl.compiler, com.opensys.clover.validator, org.jetel.sequence, org.jetel.thirdparty, com.opensys.cloveretl.addressdoctor, org.jetel.jdbc, org.jetel.component, org.jetel.connection, org.jetel.profiler, com.opensys.cloveretl.tlfunction, org.jetel.hadoop, org.jetel.engine, com.opensys.cloveretl.quickbase, com.opensys.clover.mongodb, org.jetel.ctlfunction
INFO [main] - License No. : CLP1DOWNXX10475024EX
INFO [main] - Graph definition file: graph/LinkedIn.grf
INFO [main] - Graph revision: 1.27 Modified by: 157482 Modified: Tue Dec 23 11:32:38 IST 2014
INFO [main] - Checking graph configuration…
INFO [main] - Graph configuration is valid.
INFO [main] - Graph initialization (LinkedIn)
INFO [main] - Initializing phase 0
INFO [main] - Phase 0 initialized successfully.
INFO [WatchDog_0] - Job parameters: PROJECT=., CONN_DIR=${PROJECT}/conn, DATAIN_DIR=${PROJECT}/data-in, DATAOUT_DIR=${PROJECT}/data-out, DATATMP_DIR=${PROJECT}/data-tmp, GRAPH_DIR=${PROJECT}/graph, JOBFLOW_DIR=${PROJECT}/jobflow, LOOKUP_DIR=${PROJECT}/lookup, META_DIR=${PROJECT}/meta, PROFILE_DIR=${PROJECT}/profile, SEQ_DIR=${PROJECT}/seq, TRANS_DIR=${PROJECT}/trans
INFO [WatchDog_0] - Starting up all nodes in phase [0]
INFO [WatchDog_0] - Successfully started all nodes in phase!
ERROR [WatchDog_0] - Component [Get updates from LinkedIn:GET_UPDATES_FROM_LINKED_IN] finished with status ERROR. (Out0: 0 recs)
Connection to http://api.linkedin.com refused
Connection refused: connect
ERROR [WatchDog_0] - Error details:
org.jetel.exception.JetelRuntimeException: Component [Get updates from LinkedIn:GET_UPDATES_FROM_LINKED_IN] finished with status ERROR. (Out0: 0 recs)
at org.jetel.graph.Node.createNodeException(Node.java:566)
at org.jetel.graph.Node.run(Node.java:542)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to http://api.linkedin.com refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at org.jetel.component.HttpConnector.buildAndSendRequest(HttpConnector.java:1908)
at org.jetel.component.HttpConnector.process(HttpConnector.java:1875)
at org.jetel.component.HttpConnector.executeForRecord(HttpConnector.java:2019)
at org.jetel.component.HttpConnector.execute(HttpConnector.java:1986)
at org.jetel.graph.Node.run(Node.java:505)
… 1 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
… 13 more

INFO [WatchDog_0] - Execution of phase [0] finished with error - elapsed time(sec): 1
ERROR [WatchDog_0] - !!! Phase finished with error - stopping graph run !!!
INFO [WatchDog_0] - -----------------------** Summary of Phases execution **---------------------
INFO [WatchDog_0] - Phase# Finished Status RunTime(sec) MemoryAllocation(KB)
INFO [WatchDog_0] - 0 ERROR 1 29481
INFO [WatchDog_0] - ------------------------------** End of Summary **---------------------------
INFO [WatchDog_0] - WatchDog thread finished - total execution time: 1 (sec)
INFO [main] - Freeing graph resources.
ERROR [main] -
---------------------------------------------- Error details ------------------------------------------------
Component [Get updates from LinkedIn:GET_UPDATES_FROM_LINKED_IN] finished with status ERROR. (Out0: 0 recs)
Connection to http://api.linkedin.com refused
Connection refused: connect
-------------------------------------------------------------------------------------------------------------
ERROR [main] - Execution of graph failed !

Hi,

I have just tried to run the graph you posted and it works just fine. I did not modify the graph in any way.

It seems that you created the graph ok, it is working. If it does not work on your side, I assume you have some kind of network connectivity issues. (firewall, proxy, security policy in your company, network delays, …) If you resolve them, you should be able to connect. Are you able to run the graph from a different network to confirm my theory?

Regarding your second question, the four properties you are setting are everything you need to use OAuth 1.0a. They were created exactly for this purpose. You could use OAuth 2.0 too if LinkedIn offers it but settings are a bit more complex in this case and the four properties alone are not enough to create the connection. If you want to see an example of OAuth 2.0 usage, see this Google Analytics blog post.

Regards,