本文介绍了使用“在LinkedIn上共享"上传图像时出现问题;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在尝试通过新的v2 LinkedIn API将图像发布到我的个人页面上.我正在发送以下数据:

So I am trying to post an image to my personal page through the new v2 LinkedIn API. I am sending the following data:

{"author":"urn:li:person:MYID","lifecycleState":"PUBLISHED","visibility":{"com.linkedin.ugc.MemberNetworkVisibility":"PUBLIC"},"specificContent":{"com.linkedin.ugc.ShareContent":{"shareMediaCategory":"IMAGE","shareCommentary":{"text":"Hello. Just testing the LinkedIn API."},"media":[{"status":"READY","originalUrl":"https:\/\/www.bbc.co.uk\/news","title":{"text":"BBC news"},"description":{"text":"A test post about BBC news"},"media":"urn:li:digitalmediaAsset:C4E22AQFmydgog-wKTw"}]}}}

您会看到我已经上传了图片,并且拥有成功的资产ID和参考.

As you'll see I've already uploaded the image and have a successful Asset ID and reference.

我从Linkedin获得成功的ID:urn:li:share:651159824176993XXX,但由于某种原因,我的图像从未出现?我在做什么错了?

I get a successful id back from Linkedin: urn:li:share:651159824176993XXX but for some reason my image never appears?? What am I doing wrong?

推荐答案

在创建引用已注册资产的UGC帖子之前,您需要确保该资产可用,否则您的图片将不会显示在LinkedIn上.

Before creating the UGC post referencing the registered asset, you need to make sure that the asset is AVAILABLE, otherwise your image won't appear on LinkedIn.

注册资产时,它会经历以下阶段:

When registering an asset, it goes through the following phases:

  1. 处理(LinkedIn可能会对图像进行一些优化/检查图像是否有效)
  2. 有空(您应该可以参加)
  3. CLIENT_ERROR(或我不记得的其他错误.基本上,您应该尝试使用其他资产)

对于我的应用程序,在创建带有图像的UGC帖子之前,我先确保资产可用.我怎么做?通过每5秒钟检查一次资产的状态,超时时间为5分钟(我曾经用GIF尝试过一次,直到今天仍在处理哈哈).

For my app, before creating the UGC post with the image(s), I make sure the asset(s) is / are AVAILABLE first. How do I do that? By checking the status of each asset every 5 seconds with a timeout of 5 minutes (I tried it with a GIF once and to this day is still processing haha).

一旦所有资产都可用,我就创建一个引用它们的UGC帖子,就像您在问题中所做的一样.

Once all assets are AVAILABLE, I create the UGC post referencing them, just like you did in your question.

这篇关于使用“在LinkedIn上共享"上传图像时出现问题;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 09:07