1

I'm developing an integration that will programmatically create product entries in Salesforce, and part of that process needs to be the addition of product images. I'm using the Connect API and am able to make a GET call to the right folder like this (I've scrambled the IDs and what not for this example):

https://example.salesforce.com/services/data/v52.0/connect/cms/delivery/channels/0591G0000000006/contents/query?folderId=9Pu1M000000fxUMSYI

That returns a payload like this:

{
  "currentPageUrl": "/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000006/contents/query?page=0&pageSize=250",
  "items": [
    {
      "contentKey": "MCZ2YVCGLNSBETNIG5P5QMIS4KNA",
      "contentNodes": {
        "source": {
          "fileName": "PET Round.jpg",
          "isExternal": false,
          "mediaType": "Image",
          "mimeType": "image/jpeg",
          "nodeType": "MediaSource",
          "referenceId": "05T0R000005MthL",
          "resourceUrl": "/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000007/media/MCY2YVCGLNSBETNIG5P4QMIS4KNA/content",
          "unauthenticatedUrl": "/cms/delivery/media/MCZ2YVCGLNSBETNIG5P4QMIS4KNA",
          "url": "/cms/delivery/media/MCY2YVCGLNSBETNIG5P4QMIS4KNA"
        },
        "title": {
          "nodeType": "NameField",
          "value": "844333"
        }
      },
      "contentUrlName": "844333",
      "language": "en_US",
      "managedContentId": "20T0R0000008U9qUAE",
      "publishedDate": "2021-08-18T16:20:57.000Z",
      "title": "844333",
      "type": "cms_image",
      "typeLabel": "Image",
      "unauthenticatedUrl": "/cms/delivery/v52.0/0DB1G0000008tfOWAU/contents/20Y0R0000008y9qUAE?oid=00D0R000000OI7GUAW"
    }
  ]
}

I am also able to retrieve images by contentKey with a GET call like this:

https://example.salesforce.com/services/data/v52.0/connect/cms/delivery/channels/0ap1G0000000007/media/MCZ2ZVCGLNSBETMIG5P4QMIS4KNA/content

Anyone know what the endpoint should look like and what parameters etc it should have? I'm having trouble finding anything for this specific scenario in the docs but surely there's a way.

Thanks!

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

0 Answers0