php-oauth icon indicating copy to clipboard operation
php-oauth copied to clipboard

Escaping of URL prevents requesting LinkedIn data

Open appsol opened this issue 10 years ago • 2 comments

I can get data from LinkedIn using the URL:

people/~:(id,num-connections,num-connections-capped)?format=json

However when using the library, the URL is escaped to produce:

people/~%3A%28id%2Cnum-connections%2Cnum-connections-capped%29

This is rejected by LinkedIn with:

Could not find person based on: ~%3A%28id%2Cnum-connections%2Cnum-connections-capped%29

Is there a way to prevent the URL being escaped before being used?

appsol avatar Jun 27 '15 22:06 appsol

I'm having this issue as well, I get that error when I use the CURL request in the web console, but my app is coming back with this error:

array (size=5)
  'errorCode' => int 0
  'message' => string 'Unknown field {~%3A%28first-name%2Clast-name%2Cemail-address%29} in resource {Root}' (length=83)
  'requestId' => string 'asdfghjk' (length=10)
  'status' => int 400
  'timestamp' => int 1435742730817

I have already posted on StackOverflow here: http://stackoverflow.com/questions/31157608/linkedin-api-error-unknown-field-in-resource-root

adamtester avatar Jul 01 '15 09:07 adamtester

@log3 I think the issue is with the League\Url package. It's not so much an error as just a requirement to be able to turn off the escaping of URLs. I'll dig into it some more when I get time and see if there is a way to work with it.

appsol avatar Jul 01 '15 15:07 appsol