在 Linkedin 群组中将帖子标记为促销或职位

发布于 2024-12-14 06:35:12 字数 250 浏览 0 评论 0原文

如何使用 Groups API 在 LinkedIn 中将帖子标记为职位?

我有我的帖子的 PostId。我唯一需要做的就是将该帖子标记为工作,以便它将显示在 LinkedIn 群组的工作讨论部分中。

但是当我调用 API 时,它给出了 400 Bad Request 错误。有谁知道为什么?

How can I flag a post as job in LinkedIn using Groups API?

I have the PostId of my post. The only thing I need to do is to flag that post as a job so that it will be displayed in the Job Discussion section in the LinkedIn Group.

But when I call the API it gives me a 400 Bad Request Error. Does anyone know why?

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

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

发布评论

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

评论(1

世界和平 2024-12-21 06:35:12

解决方案类似于此函数

access_token 是您的令牌 oauth2

idP 是帖子的 id

Sub FlagPost(ByVal access_token As String, ByVal idP As String)

    Dim body As String = "<?xml version='1.0' encoding='UTF-8'?><code>job</code>"

    Dim flagasjob As HttpWebRequest = HttpWebRequest.Create("https://api.linkedin.com/v1/posts/" & idP & "/category/code?oauth2_access_token=" & access_token)


    flagasjob.ContentType = "text/xml"
    flagasjob.Method = "PUT"

    Dim codFlag As UTF8Encoding = New UTF8Encoding()
    Dim bytesFlag As Byte() = codFlag.GetBytes(body)
    flagasjob.ContentLength = bytesFlag.Length

    Dim stmFlag As Stream
    stmFlag = flagasjob.GetRequestStream()
    stmFlag.Write(bytesFlag, 0, bytesFlag.Length)
    stmFlag.Close()

End Sub

the solution is something like this function

access_token is your token oauth2

idP is the id of the post

Sub FlagPost(ByVal access_token As String, ByVal idP As String)

    Dim body As String = "<?xml version='1.0' encoding='UTF-8'?><code>job</code>"

    Dim flagasjob As HttpWebRequest = HttpWebRequest.Create("https://api.linkedin.com/v1/posts/" & idP & "/category/code?oauth2_access_token=" & access_token)


    flagasjob.ContentType = "text/xml"
    flagasjob.Method = "PUT"

    Dim codFlag As UTF8Encoding = New UTF8Encoding()
    Dim bytesFlag As Byte() = codFlag.GetBytes(body)
    flagasjob.ContentLength = bytesFlag.Length

    Dim stmFlag As Stream
    stmFlag = flagasjob.GetRequestStream()
    stmFlag.Write(bytesFlag, 0, bytesFlag.Length)
    stmFlag.Close()

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