Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client#companies requests incorrect URL when :is_admin and :fields options are set #214

Open
hundredwatt opened this issue Feb 5, 2014 · 1 comment
Labels

Comments

@hundredwatt
Copy link
Collaborator

This was discovered on v0.4.6

When I use the #companies method like so, I get an Exception:

1.9.3-p484 :001 > client.company(is_admin: 'true', fields: %w(id name universal-name email-domains company-type))
=> LinkedIn::Errors::GeneralError: (400): URL must contain a valid resource type

I used HTTPLogger to see what url was being requested:

 HTTP GET (267.90ms)   https://api.linkedin.com:443/v1/companies?is-company-admin=true:(id,name,universal-name,email-domains,company-type)

This is incorrect. It should be: https://api.linkedin.com:443/v1/companies:(id,name,universal-name,email-domains,company-type)?is-company-admin=true

Workaround:

1.9.3-p484 :001 > client.send(:get, '/companies:(id,name,universal-name,email-domains,company-type)?is-company-admin=true')
=> "{\n  \"_total\": 1,\n  \"values\": [{\n    \"companyType\": {\n      \"code\": \"P\",\n      \"name\": \"Privately Held\"\n    },\n    \"emailDomains\": {\n      \"_total\": 1,\n      \"values\": [\"gaggleamp.com\"]\n    },\n    \"id\": 1585351,\n    \"name\": \"GaggleAMP\",\n    \"universalName\": \"gaggleamp\"\n  }]\n}"
1.9.3-p484 :001 > LinkedIn::Mash.from_json _
=> {"total"=>1,
 "all"=>...
@dfrancisc
Copy link

nicee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants