一种通过rails与linkedin的消息传递api对话的方法

发布于 2024-11-26 04:45:45 字数 790 浏览 2 评论 0原文

场景:

我是某个网站(Rails 应用程序)的注册用户。

我链接了我的联系人,我想邀请他们查看此应用程序(随后他们将注册到此应用程序中)。

为此,我将向他们发送一条带有主题和正文的消息。

希望之光:

我需要使用消息传递linkedin 的 api 并让它与我的 Rails 应用程序对话。我无法使用链接的 connections api 来检索基本上任何电子邮件地址linkedin api 的不会公开我的(已链接的注册用户)联系人电子邮件。

为了与我的 Rails 应用程序中的连接 API 进行交互,我使用了 linkedin gem。到目前为止,这个 gem 看起来还不支持 linkedin 的消息传递 api。

最后:

有什么想法我可以从哪里开始做这件事吗?我有点无能为力,因为我从来没有直接使用过 api,..但是..:)。

我使用的是 Ubuntu 10.04 操作系统。

谢谢

Scenario:

I'm a registered user of a site(a rails app).

I have my contacts in linked in whom I would like to invite to see this app(it would be followed up with their registration into this app).

For this , I would be sending them a message with a subject and body.

Rays of Hope:

I need to make use of the messaging api of linkedin and make it talk with my rails app. I can't use the connections api of linked in to retrieve the email addresses as basically any of the linkedin api's don't expose my(the registered user of linked in) contacts email.

To talk with the connections api in my rails app, I was making use of the linkedin gem. It doesn't look like this gem as of now has support for the messaging api of linkedin.

Finally:

Any ideas where can I get started on this..?. I'm kinda clueless as I have never played around with api's directly, ..yet..:).

I'm on Ubuntu 10.04 OS.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

几度春秋 2024-12-03 04:45:45

我也遇到了同样的问题,宝石缺少消息传递功能。通过使用现有代码作为参考,我将此代码放入初始化程序文件(config/initializer)中并且它起作用了。尝试一下。

LinkedIn::Client.class_eval do
# options should be a hash like this:
# options = {:recipients => {:values => [:person => {:_path => "/people/~" }, :person =>   {:_path => "/people/USER_ID"} ]}, :subject => "Something",:body => "To read" }
  def send_message(options)
    path = "/people/~/mailbox"
    post(path, options.to_json, "Content-Type" => "application/json")
  end
end

I had the same problem with the gem lacking messaging functionality. By using the existing code as a reference, I threw this code in an initializer file (config/initializer) and it worked. Give it a try.

LinkedIn::Client.class_eval do
# options should be a hash like this:
# options = {:recipients => {:values => [:person => {:_path => "/people/~" }, :person =>   {:_path => "/people/USER_ID"} ]}, :subject => "Something",:body => "To read" }
  def send_message(options)
    path = "/people/~/mailbox"
    post(path, options.to_json, "Content-Type" => "application/json")
  end
end
凉城凉梦凉人心 2024-12-03 04:45:45

这可能无法完全回答问题,但可能会有所帮助..

您是否看过这里:

https://github.com/pengwynn/linkedin/blob/master/lib/linked_in/api/update_methods.rb

如果您将问题记录在项目存储库并包含一些代码,
整个社区可以尝试提供帮助:

https://github.com/pengwynn/linkedin/issues

由永利荷兰在联系他时提供。功劳归于他..:)

This might not exactly answer the question, but could be of some help..

Have you looked here:

https://github.com/pengwynn/linkedin/blob/master/lib/linked_in/api/update_methods.rb

If you'll log an issue on the project repo and include some code, the
whole community can try to help:

https://github.com/pengwynn/linkedin/issues

This was provided by Wynn Netherland on contacting him. Credit goes to him..:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文