Linkedin资产complete_multipartUpload api抛出401

时间:2018-04-24 13:49:40

标签: linkedin linkedin-api

我尝试使用multipart linkedin v2资产上传API上传视频。成功上传所有部件后。当我试图完成上传时,它会抛出401错误响应。

请求

curl -v -X POST -H "Content-Type:application/json" -H "X-RestLi-Protocol-Version:2.0.0" "https://api.linkedin.com/v2/assets?action=completeMultiPartUpload&oauth2_access_token=xxxx" --data '{"completeMultipartUploadRequest":{"metadata":"abcdhjf lmmfk45322jnmdfmndk","partUploadResponses":[{"httpStatusCode":200,"headers":{"ETag":"d8b472e8f16603b7b6ca4a0cbb1653eb"}},{"httpStatusCode":200,"headers":{"ETag":"30a52d0e398863a1e47418c468ec8929"}},{"httpStatusCode":200,"headers":{"ETag":"92431e62823450eeb0def68024872882"}},{"httpStatusCode":200,"headers":{"ETag":"e6a9c6eacffd9d1f2532eac83d3208e3"}},{"httpStatusCode":200,"headers":{"ETag":"e6bfcf0807a71d63b48d58545101852c"}},{"httpStatusCode":200,"headers":{"ETag":"d355aa0d72c6787e9bfe5f66967c12ba"}},{"httpStatusCode":200,"headers":{"ETag":"1bc89f2c688b6abb970862a3326474fe"}},{"httpStatusCode":200,"headers":{"ETag":"9d89fff03e36ea12e4f0c842d3bb5431"}},{"httpStatusCode":200,"headers":{"ETag":"30f10c2baab55a0185eb396a06b86d39"}},{"httpStatusCode":200,"headers":{"ETag":"e1dc1eac95ab7ef51e38aeb7702b7e4f"}},{"httpStatusCode":200,"headers":{"ETag":"2365a3d1334953209611aef89739e751"}}],"mediaArtifact":"urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:abc123,urn:li:digitalmediaMediaArtifactClass:aws-userUploadedVideo)"}}'

回复

{"message":"com.linkedin.vector.assetmanager.logic.LogicLayerException: Enforced Tenant ACL result: false, for Tenant urn:li:digitalmediaTenant:5 and Method complete_multipartUpload","status":401}

有人可以帮忙解决这个问题吗?

2 个答案:

答案 0 :(得分:1)

我遇到了这个问题并联系了LinkedIn。他们只是告诉我他们已经修好了,当我现在尝试完成我的分段上传请求时,它正常工作。

答案 1 :(得分:1)

“完整的分段上传”中的“元数据”字段的期望值是多少?是上载的媒体ID还是任何令牌?如果是令牌,那么我们可以从哪里生成该令牌。