2012-12-20 4 views
1

와 LinkedIn의 공유 API를 사용하는 잘 작동 :어떻게 링크드 인 API 보석으로, 나는 레일 3을 실행하고있어 레일 보석

response = client.add_share(:comment => 'new share API', :title => 'Linkedin Share API', :url => 'http://developer.linkedin.com/docs/DOC-1212', :image_url => 'http://images.bizjournals.com/travel/cityscapes/thumbs/sm_sanfrancisco.jpg') 
:

response = client.add_share(:comment => 'new share API') 

이 실패3210

오류 :

LinkedIn::Errors::GeneralError ((400): Invalid xml {Expected elements '[email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1' instead of '[email protected]://api.linkedin.com/v1' here in element [email protected]://api.linkedin.com/v1, Expected elements '[email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1 [email protected]://api.linkedin.com/v1' instead of '[email protected]://api.linkedin.com/v1' here in element [email protected]://api.linkedin.com/v1}): 

아이디어가 있으십니까? 감사합니다

답변

0

잘못하고 있어요.

response = client.add_share(:comment => 'Sample Job', 
          :content => { :title => 'LinkedIn Developers Documentation On Using the Share API', :description => 'Leverage the Share API to maximize engagement on user-generated content on LinkedIn', :'submitted-url' => 'https://developer.linkedin.com/documents/share-api', :'submitted-image-url' => 'http://m3.licdn.com/media/p/3/000/124/1a6/089a29a.png' }) 
:이 https://developer.linkedin.com/documents/share-api#toggleview:id=xml

<share> 
    <comment>Check out the LinkedIn Share API!</comment> 
    <content> 
    <title>LinkedIn Developers Documentation On Using the Share API</title> 
    <description>Leverage the Share API to maximize engagement on user-generated content on LinkedIn</description> 
    <submitted-url>https://developer.linkedin.com/documents/share-api</submitted-url> 
    <submitted-image-url>http://m3.licdn.com/media/p/3/000/124/1a6/089a29a.png</submitted-image-url> 
    </content> 
    <visibility> 
    <code>anyone</code> 
    </visibility> 
</share> 

샘플 요청의 XML 그래서 요청 샘플 요청에 따라이 같은 것을 보일 것입니다

관련 문제