0

I am using the ugcPost endpoint to generate my shares.

According to documentation I am making a pre-upload request (with multipart settings included), and I receive what seems like the appropriate multipart response to that request. However, there are absolutely NO aws key-id or anything... the headers mentioned in the sample are not the ones I am receiving after registering the upload as multipart.

They mention this response to a single part upload request:

{
  "value": {
      "asset": "urn:li:digitalmediaAsset:C5400AQHpR1ANqMWqNA",
      "mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C5400AQHpR1ANqMWqNA,urn:li:digitalmediaMediaArtifactClass:aws-userUploadedVideo)",
      "uploadMechanism": {
          "com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
              "headers": {
                  "Content-Type": "application/octet-stream",
                  "x-amz-server-side-encryption": "aws:kms",
                  "x-amz-server-side-encryption-aws-kms-key-id": "e10ace24-blah-4977-bar-89foo193e2ab"
              },
              "uploadUrl": "https://video-uploads.s3-accelerate.amazonaws.com/C5400AQHpR1ANqMWqNA/aws-userUploadedVideo?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20180120T000018Z&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-server-side-encryption%3Bx-amz-server-side-encryption-aws-kms-key-id&X-Amz-Expires=86400&X-Amz-Credential=AKIAJYU2MA%2F20180120%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=f7c0756a80998786766588878768778768977687d4c687b3f1a0e8"
          }
      }
   }
}

However, I am receiving something like this when I register a multipart upload:

{
   "value": {
       "uploadMechanism": {
           "com.linkedin.digitalmedia.uploading.MultipartUpload": {
              "metadata": "base64_encoded_metadata",
              "partUploadRequests": [
                  {
                      "headers": {
                          "Content-Length": "5242880",
                          "Content-Type": "application/octet-stream"
                      },
                      "urlExpiresAt": 1558459064787,
                      "byteRange": {
                          "lastByte": 5242879,
                          "firstByte": 0
                      },
                      "url": "https://video-uploads-prod.s3-accelerate.amazonaws.com/ABCD/aws-userUploadedVideo?uploadId=xxx&partNumber=1&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=xxx&X-Amz-SignedHeaders=content-length%3Bcontent-type%3Bhost&X-Amz-Expires=86400&X-Amz-Credential=xxx&X-Amz-Signature=xxx"
                  },
                  {...other_parts...}
               ]
            }
        }
    }
}

As I understand this, I am supposed to iterate on the partUploadRequests array and use the headers contained on each 'chunk' there to make the multipart upload. These headers that I get... I am not getting the "x-amz-server-side-encryption" headers back from LinkedIn when I request it as multipart. So when I attempt the upload of a chunk I get an error from amazon saying something about the signature...

<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated...(truncated)

I have had no problems making this request outside the realm of multi-part uploads... but when I try to make it multi-part, it fails royally.

Consistent with their api docs, I'd expect to get a 4xx error if I didn't have permissions to perform this action... but I am not getting such error, I just don't get the right headers back from LinkedIn?

This here is what I send in the body of the initial upload registration request:

{
    "registerUploadRequest": {
        "supportedUploadMechanism": ["MULTIPART_UPLOAD"],
        "fileSize": 123123123,
        "owner": "url:li:organization:x123123123",
        "recipes": [
            "urn:li:digitalmediaRecipe:feedshare-video"
        ],
        "serviceRelationships": [
            {
                "identifier": "urn:li:userGeneratedContent",
                "relationshipType": "OWNER"
            }
        ]
    }
}

My app has Marketing Dev. Platform access, and I am following these documentation indications: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/vector-asset-api#register-an-upload

So far, unsuccessful only when trying to do multi-part uploads. I have been able to successfully publish single image posts, and article type of posts so far... but Video uploads are eluding me...

Anyone that can shed some light on this?

EDIT: Almost instantly after posting this, (didn't show up before when I searched earlier) I found this question that seems to hint that this kind of upload is not yet supported?? So far this has a taste of errors, can anyone further confirm this is unsupported!?

EffectiX
  • 316
  • 2
  • 6

1 Answers1

0

Video Uploads are a restricted feature that is granted to select developers only.

Source: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api

Christopher Ou
  • 574
  • 2
  • 5
  • Oh... I thought that is what I got when I received an email stating that: "We are happy to share that your request for Marketing Analytics, Community Management and Ad Tech APIs has been approved. As such, the API key you included in your application has been provisioned with access and you may now begin leveraging these APIs in accordance with our Marketing Developer Program Terms." So... the Community Management apis do not include access to uploading video via the ugcPost api!? This whole thing is so confusing... Is this the extinguish step yet? (Embrace, Extend, Extinguish lol) – EffectiX May 28 '19 at 15:19