Chilkat Online Tools

DataFlex / Salesforce Platform APIs / Feed Elements, Post and Search

Back to Collection Items

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sText
    String sMotifColor
    String sMotifLargeIconUrl
    String sMotifMediumIconUrl
    String sMotifSmallIconUrl
    String sMotifSvgIconUrl
    String sReferenceId
    String sReferenceUrl
    String sAdditionalLabel
    String sCommunityNickname
    String sCompanyName
    String sDisplayName
    String sFirstName
    String sId
    Boolean iIsActive
    Boolean iIsInThisCommunity
    String sLastName
    String sColor
    String sLargeIconUrl
    String sMediumIconUrl
    String sSmallIconUrl
    String sSvgIconUrl
    String sMySubscription
    String sName
    String sMessage
    String sFullEmailPhotoUrl
    String sLargePhotoUrl
    String sMediumPhotoUrl
    String sPhotoVersionId
    String sSmallPhotoUrl
    String sStandardEmailPhotoUrl
    String sV_Url
    String sReputation
    String sTitle
    String sV_Type
    String sActorUrl
    String sUserType
    Boolean iIsRichText
    String sText
    Boolean iIsBookmarkedByCurrentUser
    Boolean iIsLikedByCurrentUser
    String sLikesMessage
    String sMyLike
    Integer iCurrentPageToken
    String sCurrentPageUrl
    String sNextPageToken
    String sNextPageUrl
    String sPreviousPageToken
    String sPreviousPageUrl
    Integer iTotal
    Boolean iCanContextUserUpdateIsClosed
    Boolean iIsClosed
    String sPageCurrentPageToken
    String sPageCurrentPageUrl
    String sPageNextPageToken
    String sPageNextPageUrl
    String sPagePreviousPageToken
    String sPagePreviousPageUrl
    Integer iPageTotal
    Boolean iIsEditRestricted
    String sIsEditableByMeUrl
    String sLastEditedBy
    String sLastEditedDate
    Integer iLatestRevision
    String sRelativeLastEditedDate
    Integer iCount
    Boolean iIsMutedByMe
    Boolean iIsReadByMe
    String sLastReadDateByMe
    String sFeedEntityStatus
    Boolean iIsApprovableByMe
    Boolean iCanAssignTopics
    Integer iDownVoteCount
    String sMyVote
    Integer iUpVoteCount
    String sApplicationName
    String sApplicationUrl
    String sCreatedDate
    Boolean iV_event
    String sFeedElementType
    Boolean iHasVerifiedComment
    String sHeaderIsRichText
    String sHeaderText
    String sId
    Boolean iIsDeleteRestricted
    Boolean iIsSharable
    String sModifiedDate
    String sOriginalFeedItem
    String sOriginalFeedItemActor
    String sLabel
    String sLabelPlural
    String sParentId
    String sMotifColor
    String sMotifLargeIconUrl
    String sMotifMediumIconUrl
    String sMotifSmallIconUrl
    String sMotifSvgIconUrl
    String sParentMySubscription
    String sParentName
    String sParentType
    String sParentUrl
    String sPhotoUrl
    String sRelativeCreatedDate
    String sV_type
    String sUrl
    String sVisibility
    Integer i
    Integer iCount_i
    String sTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get ComQuickRequest Of hoHttp "POST" "Item" To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "actor": {
    //     "additionalLabel": null,
    //     "communityNickname": "User1696423780773910041",
    //     "companyName": "Salesforce",
    //     "displayName": "Name",
    //     "firstName": "Firstname",
    //     "id": "005...",
    //     "isActive": true,
    //     "isInThisCommunity": true,
    //     "lastName": "Name",
    //     "motif": {
    //       "color": "1B96FF",
    //       "largeIconUrl": "/img/icon/profile64.png",
    //       "mediumIconUrl": "/img/icon/profile32.png",
    //       "smallIconUrl": "/img/icon/profile16.png",
    //       "svgIconUrl": null
    //     },
    //     "mySubscription": null,
    //     "name": "Name",
    //     "outOfOffice": {
    //       "message": ""
    //     },
    //     "photo": {
    //       "fullEmailPhotoUrl": "https://<my_domain>/ncsphoto/1wsMlOd3tVC7boygqBO8wMT9KzA0D6tqzpbs-Uw0IogXzXAXaYKJnuWCNQmXymRq?fromEmail=1",
    //       "largePhotoUrl": "https://<my_domain>/profilephoto/729.../F",
    //       "mediumPhotoUrl": "https://<my_domain>/profilephoto/729.../M",
    //       "photoVersionId": "729...",
    //       "smallPhotoUrl": "https://<my_domain>/profilephoto/729.../T",
    //       "standardEmailPhotoUrl": "https://<my_domain>/ncsphoto/1wsMlOd3tVC7boygqBO8wMT9KzA0D6tqzpbs-Uw0Ioi-dtynkoFWsl46as__TDFU?fromEmail=1",
    //       "url": "/services/data/v58.0/connect/user-profiles/005.../photo"
    //     },
    //     "reputation": null,
    //     "title": null,
    //     "type": "User",
    //     "url": "/services/data/v58.0/chatter/users/005...",
    //     "userType": "Internal"
    //   },
    //   "body": {
    //     "isRichText": false,
    //     "messageSegments": [
    //       {
    //         "text": "New Feed Item",
    //         "type": "Text"
    //       }
    //     ],
    //     "text": "New Feed Item"
    //   },
    //   "capabilities": {
    //     "associatedActions": {
    //       "platformActionGroups": [
    //       ]
    //     },
    //     "bookmarks": {
    //       "isBookmarkedByCurrentUser": false
    //     },
    //     "chatterLikes": {
    //       "isLikedByCurrentUser": false,
    //       "likesMessage": null,
    //       "myLike": null,
    //       "page": {
    //         "currentPageToken": 0,
    //         "currentPageUrl": "/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/chatter-likes/items",
    //         "items": [
    //         ],
    //         "nextPageToken": null,
    //         "nextPageUrl": null,
    //         "previousPageToken": null,
    //         "previousPageUrl": null,
    //         "total": 0
    //       }
    //     },
    //     "close": {
    //       "canContextUserUpdateIsClosed": true,
    //       "isClosed": false
    //     },
    //     "comments": {
    //       "page": {
    //         "currentPageToken": null,
    //         "currentPageUrl": "/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/comments/items",
    //         "items": [
    //         ],
    //         "nextPageToken": null,
    //         "nextPageUrl": null,
    //         "previousPageToken": null,
    //         "previousPageUrl": null,
    //         "total": 0
    //       }
    //     },
    //     "edit": {
    //       "isEditRestricted": false,
    //       "isEditableByMeUrl": "/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/edit/is-editable-by-me",
    //       "lastEditedBy": null,
    //       "lastEditedDate": null,
    //       "latestRevision": 1,
    //       "relativeLastEditedDate": null
    //     },
    //     "interactions": {
    //       "count": 0
    //     },
    //     "mute": {
    //       "isMutedByMe": false
    //     },
    //     "readBy": {
    //       "isReadByMe": true,
    //       "lastReadDateByMe": "2023-11-22T11:06:07.000Z",
    //       "page": {
    //         "currentPageToken": null,
    //         "currentPageUrl": "/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/read-by/items?pageSize=3",
    //         "items": [
    //         ],
    //         "nextPageToken": null,
    //         "nextPageUrl": null,
    //         "previousPageToken": null,
    //         "previousPageUrl": null,
    //         "total": 0
    //       }
    //     },
    //     "status": {
    //       "feedEntityStatus": "Published",
    //       "isApprovableByMe": true
    //     },
    //     "topics": {
    //       "canAssignTopics": true,
    //       "items": [
    //       ]
    //     },
    //     "upDownVote": {
    //       "downVoteCount": 0,
    //       "myVote": "None",
    //       "upVoteCount": 0
    //     }
    //   },
    //   "clientInfo": {
    //     "applicationName": "Postman Playground",
    //     "applicationUrl": null
    //   },
    //   "createdDate": "2023-11-22T11:06:07.000Z",
    //   "event": false,
    //   "feedElementType": "FeedItem",
    //   "hasVerifiedComment": false,
    //   "header": {
    //     "isRichText": null,
    //     "messageSegments": [
    //       {
    //         "motif": {
    //           "color": "1B96FF",
    //           "largeIconUrl": "/img/icon/profile64.png",
    //           "mediumIconUrl": "/img/icon/profile32.png",
    //           "smallIconUrl": "/img/icon/profile16.png",
    //           "svgIconUrl": null
    //         },
    //         "reference": {
    //           "id": "005...",
    //           "url": "/services/data/v58.0/chatter/users/005..."
    //         },
    //         "text": "Name",
    //         "type": "EntityLink"
    //       }
    //     ],
    //     "text": "Name"
    //   },
    //   "id": "0D5...",
    //   "isDeleteRestricted": false,
    //   "isSharable": false,
    //   "modifiedDate": "2023-11-22T11:06:07.000Z",
    //   "originalFeedItem": null,
    //   "originalFeedItemActor": null,
    //   "parent": {
    //     "entityLabel": {
    //       "label": "Account",
    //       "labelPlural": "Accounts"
    //     },
    //     "id": "001...",
    //     "motif": {
    //       "color": "5867E8",
    //       "largeIconUrl": "/img/icon/accounts64.png",
    //       "mediumIconUrl": "/img/icon/accounts32.png",
    //       "smallIconUrl": "/img/icon/accounts16.png",
    //       "svgIconUrl": null
    //     },
    //     "mySubscription": null,
    //     "name": "Burlington Textiles Corp of America",
    //     "type": "Account",
    //     "url": "/services/data/v58.0/chatter/records/001..."
    //   },
    //   "photoUrl": "https://<my_domain>/profilephoto/729.../T",
    //   "relativeCreatedDate": "Just now",
    //   "type": "TextPost",
    //   "url": "/services/data/v58.0/chatter/feed-elements/0D5...",
    //   "visibility": "InternalUsers"
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    Get ComStringOf Of hoJResp "actor.additionalLabel" To sAdditionalLabel
    Get ComStringOf Of hoJResp "actor.communityNickname" To sCommunityNickname
    Get ComStringOf Of hoJResp "actor.companyName" To sCompanyName
    Get ComStringOf Of hoJResp "actor.displayName" To sDisplayName
    Get ComStringOf Of hoJResp "actor.firstName" To sFirstName
    Get ComStringOf Of hoJResp "actor.id" To sId
    Get ComBoolOf Of hoJResp "actor.isActive" To iIsActive
    Get ComBoolOf Of hoJResp "actor.isInThisCommunity" To iIsInThisCommunity
    Get ComStringOf Of hoJResp "actor.lastName" To sLastName
    Get ComStringOf Of hoJResp "actor.motif.color" To sColor
    Get ComStringOf Of hoJResp "actor.motif.largeIconUrl" To sLargeIconUrl
    Get ComStringOf Of hoJResp "actor.motif.mediumIconUrl" To sMediumIconUrl
    Get ComStringOf Of hoJResp "actor.motif.smallIconUrl" To sSmallIconUrl
    Get ComStringOf Of hoJResp "actor.motif.svgIconUrl" To sSvgIconUrl
    Get ComStringOf Of hoJResp "actor.mySubscription" To sMySubscription
    Get ComStringOf Of hoJResp "actor.name" To sName
    Get ComStringOf Of hoJResp "actor.outOfOffice.message" To sMessage
    Get ComStringOf Of hoJResp "actor.photo.fullEmailPhotoUrl" To sFullEmailPhotoUrl
    Get ComStringOf Of hoJResp "actor.photo.largePhotoUrl" To sLargePhotoUrl
    Get ComStringOf Of hoJResp "actor.photo.mediumPhotoUrl" To sMediumPhotoUrl
    Get ComStringOf Of hoJResp "actor.photo.photoVersionId" To sPhotoVersionId
    Get ComStringOf Of hoJResp "actor.photo.smallPhotoUrl" To sSmallPhotoUrl
    Get ComStringOf Of hoJResp "actor.photo.standardEmailPhotoUrl" To sStandardEmailPhotoUrl
    Get ComStringOf Of hoJResp "actor.photo.url" To sV_Url
    Get ComStringOf Of hoJResp "actor.reputation" To sReputation
    Get ComStringOf Of hoJResp "actor.title" To sTitle
    Get ComStringOf Of hoJResp "actor.type" To sV_Type
    Get ComStringOf Of hoJResp "actor.url" To sActorUrl
    Get ComStringOf Of hoJResp "actor.userType" To sUserType
    Get ComBoolOf Of hoJResp "body.isRichText" To iIsRichText
    Get ComStringOf Of hoJResp "body.text" To sText
    Get ComBoolOf Of hoJResp "capabilities.bookmarks.isBookmarkedByCurrentUser" To iIsBookmarkedByCurrentUser
    Get ComBoolOf Of hoJResp "capabilities.chatterLikes.isLikedByCurrentUser" To iIsLikedByCurrentUser
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.likesMessage" To sLikesMessage
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.myLike" To sMyLike
    Get ComIntOf Of hoJResp "capabilities.chatterLikes.page.currentPageToken" To iCurrentPageToken
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.page.currentPageUrl" To sCurrentPageUrl
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.page.nextPageToken" To sNextPageToken
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.page.nextPageUrl" To sNextPageUrl
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.page.previousPageToken" To sPreviousPageToken
    Get ComStringOf Of hoJResp "capabilities.chatterLikes.page.previousPageUrl" To sPreviousPageUrl
    Get ComIntOf Of hoJResp "capabilities.chatterLikes.page.total" To iTotal
    Get ComBoolOf Of hoJResp "capabilities.close.canContextUserUpdateIsClosed" To iCanContextUserUpdateIsClosed
    Get ComBoolOf Of hoJResp "capabilities.close.isClosed" To iIsClosed
    Get ComStringOf Of hoJResp "capabilities.comments.page.currentPageToken" To sPageCurrentPageToken
    Get ComStringOf Of hoJResp "capabilities.comments.page.currentPageUrl" To sPageCurrentPageUrl
    Get ComStringOf Of hoJResp "capabilities.comments.page.nextPageToken" To sPageNextPageToken
    Get ComStringOf Of hoJResp "capabilities.comments.page.nextPageUrl" To sPageNextPageUrl
    Get ComStringOf Of hoJResp "capabilities.comments.page.previousPageToken" To sPagePreviousPageToken
    Get ComStringOf Of hoJResp "capabilities.comments.page.previousPageUrl" To sPagePreviousPageUrl
    Get ComIntOf Of hoJResp "capabilities.comments.page.total" To iPageTotal
    Get ComBoolOf Of hoJResp "capabilities.edit.isEditRestricted" To iIsEditRestricted
    Get ComStringOf Of hoJResp "capabilities.edit.isEditableByMeUrl" To sIsEditableByMeUrl
    Get ComStringOf Of hoJResp "capabilities.edit.lastEditedBy" To sLastEditedBy
    Get ComStringOf Of hoJResp "capabilities.edit.lastEditedDate" To sLastEditedDate
    Get ComIntOf Of hoJResp "capabilities.edit.latestRevision" To iLatestRevision
    Get ComStringOf Of hoJResp "capabilities.edit.relativeLastEditedDate" To sRelativeLastEditedDate
    Get ComIntOf Of hoJResp "capabilities.interactions.count" To iCount
    Get ComBoolOf Of hoJResp "capabilities.mute.isMutedByMe" To iIsMutedByMe
    Get ComBoolOf Of hoJResp "capabilities.readBy.isReadByMe" To iIsReadByMe
    Get ComStringOf Of hoJResp "capabilities.readBy.lastReadDateByMe" To sLastReadDateByMe
    Get ComStringOf Of hoJResp "capabilities.readBy.page.currentPageToken" To sPageCurrentPageToken
    Get ComStringOf Of hoJResp "capabilities.readBy.page.currentPageUrl" To sPageCurrentPageUrl
    Get ComStringOf Of hoJResp "capabilities.readBy.page.nextPageToken" To sPageNextPageToken
    Get ComStringOf Of hoJResp "capabilities.readBy.page.nextPageUrl" To sPageNextPageUrl
    Get ComStringOf Of hoJResp "capabilities.readBy.page.previousPageToken" To sPagePreviousPageToken
    Get ComStringOf Of hoJResp "capabilities.readBy.page.previousPageUrl" To sPagePreviousPageUrl
    Get ComIntOf Of hoJResp "capabilities.readBy.page.total" To iPageTotal
    Get ComStringOf Of hoJResp "capabilities.status.feedEntityStatus" To sFeedEntityStatus
    Get ComBoolOf Of hoJResp "capabilities.status.isApprovableByMe" To iIsApprovableByMe
    Get ComBoolOf Of hoJResp "capabilities.topics.canAssignTopics" To iCanAssignTopics
    Get ComIntOf Of hoJResp "capabilities.upDownVote.downVoteCount" To iDownVoteCount
    Get ComStringOf Of hoJResp "capabilities.upDownVote.myVote" To sMyVote
    Get ComIntOf Of hoJResp "capabilities.upDownVote.upVoteCount" To iUpVoteCount
    Get ComStringOf Of hoJResp "clientInfo.applicationName" To sApplicationName
    Get ComStringOf Of hoJResp "clientInfo.applicationUrl" To sApplicationUrl
    Get ComStringOf Of hoJResp "createdDate" To sCreatedDate
    Get ComBoolOf Of hoJResp "event" To iV_event
    Get ComStringOf Of hoJResp "feedElementType" To sFeedElementType
    Get ComBoolOf Of hoJResp "hasVerifiedComment" To iHasVerifiedComment
    Get ComStringOf Of hoJResp "header.isRichText" To sHeaderIsRichText
    Get ComStringOf Of hoJResp "header.text" To sHeaderText
    Get ComStringOf Of hoJResp "id" To sId
    Get ComBoolOf Of hoJResp "isDeleteRestricted" To iIsDeleteRestricted
    Get ComBoolOf Of hoJResp "isSharable" To iIsSharable
    Get ComStringOf Of hoJResp "modifiedDate" To sModifiedDate
    Get ComStringOf Of hoJResp "originalFeedItem" To sOriginalFeedItem
    Get ComStringOf Of hoJResp "originalFeedItemActor" To sOriginalFeedItemActor
    Get ComStringOf Of hoJResp "parent.entityLabel.label" To sLabel
    Get ComStringOf Of hoJResp "parent.entityLabel.labelPlural" To sLabelPlural
    Get ComStringOf Of hoJResp "parent.id" To sParentId
    Get ComStringOf Of hoJResp "parent.motif.color" To sMotifColor
    Get ComStringOf Of hoJResp "parent.motif.largeIconUrl" To sMotifLargeIconUrl
    Get ComStringOf Of hoJResp "parent.motif.mediumIconUrl" To sMotifMediumIconUrl
    Get ComStringOf Of hoJResp "parent.motif.smallIconUrl" To sMotifSmallIconUrl
    Get ComStringOf Of hoJResp "parent.motif.svgIconUrl" To sMotifSvgIconUrl
    Get ComStringOf Of hoJResp "parent.mySubscription" To sParentMySubscription
    Get ComStringOf Of hoJResp "parent.name" To sParentName
    Get ComStringOf Of hoJResp "parent.type" To sParentType
    Get ComStringOf Of hoJResp "parent.url" To sParentUrl
    Get ComStringOf Of hoJResp "photoUrl" To sPhotoUrl
    Get ComStringOf Of hoJResp "relativeCreatedDate" To sRelativeCreatedDate
    Get ComStringOf Of hoJResp "type" To sV_type
    Get ComStringOf Of hoJResp "url" To sUrl
    Get ComStringOf Of hoJResp "visibility" To sVisibility
    Move 0 To i
    Get ComSizeOfArray Of hoJResp "body.messageSegments" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "body.messageSegments[i].text" To sText
        Get ComStringOf Of hoJResp "body.messageSegments[i].type" To sV_type
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "capabilities.associatedActions.platformActionGroups" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "capabilities.chatterLikes.page.items" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "capabilities.comments.page.items" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "capabilities.readBy.page.items" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "capabilities.topics.items" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "header.messageSegments" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "header.messageSegments[i].motif.color" To sMotifColor
        Get ComStringOf Of hoJResp "header.messageSegments[i].motif.largeIconUrl" To sMotifLargeIconUrl
        Get ComStringOf Of hoJResp "header.messageSegments[i].motif.mediumIconUrl" To sMotifMediumIconUrl
        Get ComStringOf Of hoJResp "header.messageSegments[i].motif.smallIconUrl" To sMotifSmallIconUrl
        Get ComStringOf Of hoJResp "header.messageSegments[i].motif.svgIconUrl" To sMotifSvgIconUrl
        Get ComStringOf Of hoJResp "header.messageSegments[i].reference.id" To sReferenceId
        Get ComStringOf Of hoJResp "header.messageSegments[i].reference.url" To sReferenceUrl
        Get ComStringOf Of hoJResp "header.messageSegments[i].text" To sText
        Get ComStringOf Of hoJResp "header.messageSegments[i].type" To sV_type
        Move (i + 1) To i
    Loop



End_Procedure

Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
https://domain.com/services/data/v{{version}}/chatter/feed-elements?feedElementType=FeedItem&subjectId=<USER_GROUP_RECORD_ID>&text=New Feed Item

Postman Collection Item JSON

{
  "name": "Feed Elements, Post and Search",
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    },
    {
      "listen": "test",
      "script": {
        "exec": [
          ""
        ],
        "type": "text/javascript"
      }
    }
  ],
  "protocolProfileBehavior": {
    "disabledSystemHeaders": {
      "content-type": true
    }
  },
  "request": {
    "method": "POST",
    "header": [
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/chatter/feed-elements?feedElementType=FeedItem&subjectId=<USER_GROUP_RECORD_ID>&text=New Feed Item",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "chatter",
        "feed-elements"
      ],
      "query": [
        {
          "key": "feedElementType",
          "value": "FeedItem",
          "description": "Feed elements are the top-level objects that a feed contains. The feed element type describes the characteristics of that feed element. One of these values:\nBundle—A container of feed elements. A bundle also has a body made up of message segments that can always be gracefully degraded to text-only values.\nFeedItem—A feed item has a single parent and is scoped to one community or across all communities. A feed item can have capabilities such as bookmarks, canvas, content, comment, link, poll. Feed items have a body made up of message segments that can always be gracefully degraded to text-only values.\nRecommendation—A recommendation is a feed element with a recommendations capability. A recommendation suggests records to follow, groups to join, or applications that are helpful to the context user."
        },
        {
          "key": "subjectId",
          "value": "<USER_GROUP_RECORD_ID>"
        },
        {
          "key": "text",
          "value": "New Feed Item"
        }
      ]
    },
    "description": "Feed item and comment bodies have a 10,000 character limit. Because this limit can change, we recommend that clients make a describeSObjects() call on the FeedItem or FeedComment object. To determine the maximum number of allowed characters, look at the length of the Body or CommentBody field.\n\nhttps://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_feed_element.htm"
  },
  "response": [
    {
      "name": "Successful Feed Elements, Post and Search",
      "originalRequest": {
        "method": "POST",
        "header": [
        ],
        "url": {
          "raw": "{{_endpoint}}/services/data/v{{version}}/chatter/feed-elements?feedElementType=FeedItem&subjectId=001...&text=New Feed Item",
          "host": [
            "{{_endpoint}}"
          ],
          "path": [
            "services",
            "data",
            "v{{version}}",
            "chatter",
            "feed-elements"
          ],
          "query": [
            {
              "key": "feedElementType",
              "value": "FeedItem",
              "description": "Feed elements are the top-level objects that a feed contains. The feed element type describes the characteristics of that feed element. One of these values:\nBundle—A container of feed elements. A bundle also has a body made up of message segments that can always be gracefully degraded to text-only values.\nFeedItem—A feed item has a single parent and is scoped to one community or across all communities. A feed item can have capabilities such as bookmarks, canvas, content, comment, link, poll. Feed items have a body made up of message segments that can always be gracefully degraded to text-only values.\nRecommendation—A recommendation is a feed element with a recommendations capability. A recommendation suggests records to follow, groups to join, or applications that are helpful to the context user."
            },
            {
              "key": "subjectId",
              "value": "001..."
            },
            {
              "key": "text",
              "value": "New Feed Item"
            }
          ]
        }
      },
      "status": "Created",
      "code": 201,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Wed, 22 Nov 2023 11:06:07 GMT"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=63072000; includeSubDomains"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "X-Robots-Tag",
          "value": "none"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache,must-revalidate,max-age=0,no-store,private"
        },
        {
          "key": "Content-Type",
          "value": "application/json;charset=UTF-8"
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        },
        {
          "key": "Transfer-Encoding",
          "value": "chunked"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"actor\": {\n        \"additionalLabel\": null,\n        \"communityNickname\": \"User1696423780773910041\",\n        \"companyName\": \"Salesforce\",\n        \"displayName\": \"Name\",\n        \"firstName\": \"Firstname\",\n        \"id\": \"005...\",\n        \"isActive\": true,\n        \"isInThisCommunity\": true,\n        \"lastName\": \"Name\",\n        \"motif\": {\n            \"color\": \"1B96FF\",\n            \"largeIconUrl\": \"/img/icon/profile64.png\",\n            \"mediumIconUrl\": \"/img/icon/profile32.png\",\n            \"smallIconUrl\": \"/img/icon/profile16.png\",\n            \"svgIconUrl\": null\n        },\n        \"mySubscription\": null,\n        \"name\": \"Name\",\n        \"outOfOffice\": {\n            \"message\": \"\"\n        },\n        \"photo\": {\n            \"fullEmailPhotoUrl\": \"https://<my_domain>/ncsphoto/1wsMlOd3tVC7boygqBO8wMT9KzA0D6tqzpbs-Uw0IogXzXAXaYKJnuWCNQmXymRq?fromEmail=1\",\n            \"largePhotoUrl\": \"https://<my_domain>/profilephoto/729.../F\",\n            \"mediumPhotoUrl\": \"https://<my_domain>/profilephoto/729.../M\",\n            \"photoVersionId\": \"729...\",\n            \"smallPhotoUrl\": \"https://<my_domain>/profilephoto/729.../T\",\n            \"standardEmailPhotoUrl\": \"https://<my_domain>/ncsphoto/1wsMlOd3tVC7boygqBO8wMT9KzA0D6tqzpbs-Uw0Ioi-dtynkoFWsl46as__TDFU?fromEmail=1\",\n            \"url\": \"/services/data/v58.0/connect/user-profiles/005.../photo\"\n        },\n        \"reputation\": null,\n        \"title\": null,\n        \"type\": \"User\",\n        \"url\": \"/services/data/v58.0/chatter/users/005...\",\n        \"userType\": \"Internal\"\n    },\n    \"body\": {\n        \"isRichText\": false,\n        \"messageSegments\": [\n            {\n                \"text\": \"New Feed Item\",\n                \"type\": \"Text\"\n            }\n        ],\n        \"text\": \"New Feed Item\"\n    },\n    \"capabilities\": {\n        \"associatedActions\": {\n            \"platformActionGroups\": []\n        },\n        \"bookmarks\": {\n            \"isBookmarkedByCurrentUser\": false\n        },\n        \"chatterLikes\": {\n            \"isLikedByCurrentUser\": false,\n            \"likesMessage\": null,\n            \"myLike\": null,\n            \"page\": {\n                \"currentPageToken\": 0,\n                \"currentPageUrl\": \"/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/chatter-likes/items\",\n                \"items\": [],\n                \"nextPageToken\": null,\n                \"nextPageUrl\": null,\n                \"previousPageToken\": null,\n                \"previousPageUrl\": null,\n                \"total\": 0\n            }\n        },\n        \"close\": {\n            \"canContextUserUpdateIsClosed\": true,\n            \"isClosed\": false\n        },\n        \"comments\": {\n            \"page\": {\n                \"currentPageToken\": null,\n                \"currentPageUrl\": \"/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/comments/items\",\n                \"items\": [],\n                \"nextPageToken\": null,\n                \"nextPageUrl\": null,\n                \"previousPageToken\": null,\n                \"previousPageUrl\": null,\n                \"total\": 0\n            }\n        },\n        \"edit\": {\n            \"isEditRestricted\": false,\n            \"isEditableByMeUrl\": \"/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/edit/is-editable-by-me\",\n            \"lastEditedBy\": null,\n            \"lastEditedDate\": null,\n            \"latestRevision\": 1,\n            \"relativeLastEditedDate\": null\n        },\n        \"interactions\": {\n            \"count\": 0\n        },\n        \"mute\": {\n            \"isMutedByMe\": false\n        },\n        \"readBy\": {\n            \"isReadByMe\": true,\n            \"lastReadDateByMe\": \"2023-11-22T11:06:07.000Z\",\n            \"page\": {\n                \"currentPageToken\": null,\n                \"currentPageUrl\": \"/services/data/v58.0/chatter/feed-elements/0D5.../capabilities/read-by/items?pageSize=3\",\n                \"items\": [],\n                \"nextPageToken\": null,\n                \"nextPageUrl\": null,\n                \"previousPageToken\": null,\n                \"previousPageUrl\": null,\n                \"total\": 0\n            }\n        },\n        \"status\": {\n            \"feedEntityStatus\": \"Published\",\n            \"isApprovableByMe\": true\n        },\n        \"topics\": {\n            \"canAssignTopics\": true,\n            \"items\": []\n        },\n        \"upDownVote\": {\n            \"downVoteCount\": 0,\n            \"myVote\": \"None\",\n            \"upVoteCount\": 0\n        }\n    },\n    \"clientInfo\": {\n        \"applicationName\": \"Postman Playground\",\n        \"applicationUrl\": null\n    },\n    \"createdDate\": \"2023-11-22T11:06:07.000Z\",\n    \"event\": false,\n    \"feedElementType\": \"FeedItem\",\n    \"hasVerifiedComment\": false,\n    \"header\": {\n        \"isRichText\": null,\n        \"messageSegments\": [\n            {\n                \"motif\": {\n                    \"color\": \"1B96FF\",\n                    \"largeIconUrl\": \"/img/icon/profile64.png\",\n                    \"mediumIconUrl\": \"/img/icon/profile32.png\",\n                    \"smallIconUrl\": \"/img/icon/profile16.png\",\n                    \"svgIconUrl\": null\n                },\n                \"reference\": {\n                    \"id\": \"005...\",\n                    \"url\": \"/services/data/v58.0/chatter/users/005...\"\n                },\n                \"text\": \"Name\",\n                \"type\": \"EntityLink\"\n            }\n        ],\n        \"text\": \"Name\"\n    },\n    \"id\": \"0D5...\",\n    \"isDeleteRestricted\": false,\n    \"isSharable\": false,\n    \"modifiedDate\": \"2023-11-22T11:06:07.000Z\",\n    \"originalFeedItem\": null,\n    \"originalFeedItemActor\": null,\n    \"parent\": {\n        \"entityLabel\": {\n            \"label\": \"Account\",\n            \"labelPlural\": \"Accounts\"\n        },\n        \"id\": \"001...\",\n        \"motif\": {\n            \"color\": \"5867E8\",\n            \"largeIconUrl\": \"/img/icon/accounts64.png\",\n            \"mediumIconUrl\": \"/img/icon/accounts32.png\",\n            \"smallIconUrl\": \"/img/icon/accounts16.png\",\n            \"svgIconUrl\": null\n        },\n        \"mySubscription\": null,\n        \"name\": \"Burlington Textiles Corp of America\",\n        \"type\": \"Account\",\n        \"url\": \"/services/data/v58.0/chatter/records/001...\"\n    },\n    \"photoUrl\": \"https://<my_domain>/profilephoto/729.../T\",\n    \"relativeCreatedDate\": \"Just now\",\n    \"type\": \"TextPost\",\n    \"url\": \"/services/data/v58.0/chatter/feed-elements/0D5...\",\n    \"visibility\": \"InternalUsers\"\n}"
    }
  ]
}