Questions tagged [connect-api]

ConnectApi is the Apex namespace that includes Chatter in Apex functionality.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Get Feeds of type PendingReview filtered by UserId/Group Name

Using ConnectApi we can filter filter PendingReview Feeds by using : getFeedElementsFromFeed(communityId, ConnectApi.FeedType.PendingReview, pageParam, pageSize, ConnectApi.FeedSortOrder....
user avatar
0 votes
0 answers
9 views

CommerceWishlist class getWishlistSummaries wont take a wishlist ID

I am trying to get the product information for wishlist items. When I try to use the commercewishlist getWishlistSummaries with the optional wishlist ID i get this error. I see in the docs that this ...
user avatar
0 votes
0 answers
7 views

Get ChatterFeeds for all groups where ConnectApi.​FeedItem​AttachmentType is Question

I want to get Questions From all groups using ConnectAPI. Although there is a way to get Feed from all groups using : getFeedElementsFromFilterFeed(String communityId, String subjectId, String ...
user avatar
0 votes
1 answer
41 views

Salesforce CMS REST API: /search `NOT_FOUND`

I am attempting to hit the /connect/cms/delivery/channels/{{channelId}}/contents​/search?page=1&pageSize=20&queryTerm=test&scope=All REST API endpoint but am getting the following 404 ...
user avatar
  • 153
0 votes
1 answer
109 views

ConnectApi.CommerceCatalog.getProduct on inactive product

I am working on a B2B commerce project and I have issues with deactivated products (IsActive=false) https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/...
user avatar
  • 55
0 votes
0 answers
22 views

Get ConnectAPI.FeedElement for All groups using ConnectAPI

You can get FeedElements for a particular group using, getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle,...
user avatar
1 vote
0 answers
26 views

Salesforce Health Cloud - Connect API Specifications

Is there any way we can find API specifications (Open API) or JSON schema definitions for all Business Connect API resources and objects? I am trying to build an integration between our salesforce ...
user avatar
2 votes
1 answer
106 views

Creating a chatter post with inline images from Flow

I was trying to make a Chatter Post from a Flow. I have a ScreenFlow in order to get the richtext from the user, I save it in a variable and try to convert it in a Chatter Post via ConnectApiHelper. ...
user avatar
  • 23
0 votes
0 answers
17 views

Chatter Notification for self

I have a requirement where when a custom button is clicked based on certain criteria a chatter post is taking place where few users are being tagged. I am using the ConnectApi for the Apex logic Now ...
user avatar
0 votes
1 answer
53 views

Connect API not returning notifications

I'm using a Connected App. this is subscribed to a custom notification (0ML) i am using the SF standard API: POST /services/data/v54.0/actions/standard/customNotificationAction with this payload: { &...
user avatar
2 votes
1 answer
60 views

createReturnOrder

Hi i'm writing in Apex a code that must call to this method. I don't know how i can call it, i try with ConnectApi.ReturnOrderOutputRepresentation idReturnOrder = new ConnectApi....
user avatar
8 votes
1 answer
347 views

Retrieve standard and custom notifications of a user in Apex

Is there a way to fetch the unread bell icon notifications of a user in Apex? We have a community built on the Build Your Own (LWR) template where we need to implement an LWC component that displays ...
user avatar
  • 208
2 votes
1 answer
128 views

Tag and @mentions in custom LWC?

I'm attempting to tag a users in a custom lwc component. THis is my current code. @AuraEnabled public static void postFeedItem(String msgTxt, String recordId){ ConnectApi.FeedElement ...
user avatar
  • 3,101
2 votes
0 answers
40 views

Connect API - set ContentVersion custom field on file upload

I'm trying to upload a file with the following request: curl -H "X-PrettyPrint: 1" -F 'json={"title":"BoatPrices"};type=application/json' -F "fileData=@BoatPrices....
user avatar
0 votes
0 answers
76 views

Order Summary creation failed

On our project we have order creation for logged user and for guest. We would like to transform order to OrderSummary but it fails. In Apex we use ConnectApi.OrderSummaryCreation.createOrderSummary ...
user avatar
2 votes
1 answer
124 views

I receive an empty list of notifications using the Connect REST API endpoint: /connect/notifications

I want to get all the current user's notifications to display them in a LWC component. For this, I tried to make a REST API callout from Salesforce to the same Salesforce org using Connect REST API ...
user avatar
0 votes
0 answers
31 views

Connect API Sorting

We are using the connect API methods of ConnectApi.ChatterFeeds.getFeedElementsFromFeed ConnectApi.ChatterFeeds.getCommentsForFeedElement to display comments in a custom lightning component. Even with ...
user avatar
2 votes
0 answers
184 views

Can't run a test class on a class with ConnectApi.ManagedTopics as an Internal user OR as a Community user

I have an LWC which displays as a collapsible menu on an Experience Cloud Site. It's in a scratch org, and I'd like to deploy to production. The LWC is using a class that uses ConnectApi.ManagedTopics ...
user avatar
3 votes
1 answer
131 views

ConnectApi.ConnectApiException: Context user does not have permission to create rich text in feed

Trying to post richtext (a bolded piece of text) to a chatter feed via ConnectAPI using code below and get this error (user is System Admin) ConnectApi.ConnectApiException: Context user does not ...
user avatar
  • 61.4k
0 votes
1 answer
181 views

Setup ConnectApi.FeedElementPage with message mentions for Test (setTestGetFeedElementsFromFeed)

I have a class that uses ConnectApi.ChatterFeeds.getFeedElementsFromFeed and from the result page I extract the mentioned users. This is working as intended but now I have to create a test for this ...
user avatar
0 votes
2 answers
838 views

Chatter Post and Tag user from Apex Trigger

I'm trying to do a chatter post and tag a user on a record from Apex Trigger. I tried the following approach,per https://blog.jeffdouglas.com/2013/10/03/chatter-for-apex-code-examples/ Id userId = ...
user avatar
  • 2,136
1 vote
1 answer
678 views

How to create a test for the ManagedTopic?

I have an Apex class TopicController that has a method that returns a list of Navigational Managed Topics: public with sharing class TopicController { // Returns a list of all Navigational Managed ...
user avatar
0 votes
1 answer
157 views

how to query direct message object from the customer community plus profile?

I need to retrieve direct message data from the customer community plus user profile. How to query direct message object from the customer community plus profile? Thanks, Prasad
user avatar
1 vote
1 answer
1k views

Sending large Files to external system

From Salesforce, I am sending files to AWS Server. I am able to successfully achieve it if the file is under 3 to 4 MB. When I try with more than 6 to 7 MB, the file is getting reached to the AWS ...
user avatar
2 votes
1 answer
130 views

Does the url value for MarkupBeginSegmentInput matter?

Given a ConnectApi.MarkupBeginSegmentInput with a markupType of ConnectApi.MarkupType.HYPERLINK, the url attribute is required as stated in the documentation: https://developer.salesforce.com/docs/...
user avatar
  • 711
0 votes
1 answer
723 views

How do I avoid error ConnectApi.ConnectApiException: Cannot provide both 'Poll' and 'QuestionAndAnswers' capability values at the same time

I am trying to set a question title for a poll chatter post created by apex using the following code CollaborationGroup g = [SELECT Id FROM CollaborationGroup WHERE Name='Edge Communications Customer ...
user avatar
  • 13.2k
0 votes
1 answer
231 views

Customer user cannot create chatter post on a community group

I have an issue when I try create a post from an apex class, the user is a customer community user and I create the post from a Lightning community ConnectApi.ChatterFeeds.postFeedElement(Network....
user avatar
2 votes
0 answers
147 views

Multiple Files on chatter Feed is not showing when created from apex

I see Chatter post can allow multiple files to be posted at a time in Lightning. But from the below code in Apex, I'm only able to get one file on the chatter post. List<ConnectApi.BatchInput> ...
user avatar
  • 37
0 votes
0 answers
35 views

Is it Possible to insert Files from VF Page using Connect APIs?

I know attachments can insert through connect API. What about Files ? I have heapsize issues while insert an document with size of 5 mb Here is My Controller to Insert a file @AuraEnabled public ...
user avatar
0 votes
0 answers
286 views

Custom Chatter Feed

Trying to build a lightning component or VF page wherein I can quickly see below views of chatters, is there something nearby already available on AppExchange or Github? List of all unread chatters (...
user avatar
  • 1,099
0 votes
1 answer
925 views

Reaching Connect API's hourly request limit for this user and application?

I`ve got this type of error during the work in Lightning Community: You have reached the Connect API's hourly request limit for this user and application. Please try again later. My API Requests ...
user avatar
  • 504
0 votes
1 answer
236 views

Chatter API vs ConnectAPI

I'm trying to understand the difference between Chatter REST Api and ConnectAPI in terms of capabilities. If my task is to post to a Chatter feed from an external application, I believe there would ...
user avatar
2 votes
1 answer
43 views

Can the new Chatter API Communities resource create a Visualforce Tabs community?

In Summer '19, we got access to a new POST method on the connect/communities endpoint, allowing for programmatic creation of a Community: Make a POST request to the existing /connect/communities ...
user avatar
  • 86k
1 vote
0 answers
43 views

Get ConventVersionId via Connect API

So I'm circling back on a problem I tackled a few years ago, as I needed to update the Chatter API version that I'm using, and in doing so need to rework some code that touched the nasty hack in ...
user avatar
  • 24.7k
0 votes
1 answer
795 views

Attachments in FeedItem After Insert Trigger

I'm trying to get the attachments from a FeedItem after insert trigger, but it does not return all the associated attachments. I understand attachments are inserted after the FeedItem is inserted (ref....
user avatar
  • 311
1 vote
1 answer
174 views

How can I mark 'Best Answer' through ConnectApi?

How do I mark an answer as Best Answer through ConenctApi? I tried setting bestAnswerId of ConnectApi.QuestionAndAnswersCapabilityInput but it does not mark the answer as Best Answer. ConnectApi....
user avatar
  • 311
0 votes
1 answer
2k views

ConnectApi.NotFoundException: Resource not found (ConnectApi.Communities)

I'm trying to get the community site url, using the ConnectApi in a lightning component, with a SystemAdmin it works fine, but not with any other profile. Here is my code final Network myNetwork = [...
user avatar
  • 170
0 votes
1 answer
524 views

Connecting to metadata API in SOAP with token in PHP

I try to call retrieve in SOAP using PHP but I need to login before. For login, I have a token that I get from "https://test.salesforce.com/services/oauth2/token" So, I try to pass this token in the ...
user avatar
  • 1
0 votes
0 answers
131 views

Create Custom Chatter Feed

I was recently tasked with retrieving chatter feeds addressed to the context User {'To Me' feeds} and only those ('To Me' feeds) that were on Cases (standard Objects) that were 'Open' and getting to ...
user avatar
  • 99
2 votes
2 answers
539 views

Platform events and Chatter Posts

I am subscribing to platform events in apex trigger. In the trigger I am trying to post to user's chatter feed using Chatter Connect API. I am aware that in this case the context is "Automated Process"...
user avatar
  • 1,702
0 votes
2 answers
842 views

How to display Data in tabular format when Posting it to Chatter via Apex?

I have a requirement where I want to send email notification to User if Opportunity Close Date is last 10 days and send Chatter Feed notification when Opportunity Close Date is Last 3 days. For this ...
user avatar
0 votes
1 answer
370 views

How to find the User Reputation Level

Is there a way to directly get the user reputation level using ConnectApi. Right now I am querying the user reputation points and then comparing the points with points required to achieve that level ...
user avatar
  • 793
0 votes
1 answer
472 views

ConnectApi Bulkified class

In my org ConnectApi.FeedItem used in many places so I think we can have general class to make it work from different logics to avoid duplicate code. so for that i created a class and implement that ...
user avatar
  • 35
1 vote
2 answers
2k views

How do I test that a ConnectApi.AnnouncementInput has been posted to a CollaborationGroup?

I have a trigger that posts a ConnectApi.AnnouncementInput, but how do I test that this has been posted, and to the correct chattergroup? I've created the test collaborationgroup in my test method, ...
user avatar
  • 327
1 vote
1 answer
46 views

How can I use ConnectApi.ModerationCapability to automatically flag records containing bad words?

We have a requirement wherein chats/discussion(this is a custom object) having a bad words needs to be flagged in moderation to review. How can I use ConnectApi.ModerationCapability to automatically ...
user avatar
  • 13
1 vote
0 answers
249 views

How can I create a meaningful test of a function which creates a Queueable which posts Announcements through the ConnectApi?

I have this method: public Id doPostAlerts(List<Product2> productList){ List<ConnectApi.AnnouncementInput> announcementInputList = new List<ConnectApi.AnnouncementInput>(); ...
user avatar
0 votes
1 answer
1k views

Connect to SharePoint from Apex using Files Connect API

I'm trying to create a Lightning component that lists the files in a SharePoint Folder. The opportunity has a custom field specifying which folder to list. I can see the files when I navigate to the ...
user avatar
1 vote
1 answer
2k views

ConnectApi.NotFoundException: Resource not found

I am getting an error when using the ConnectApi to post a feed: ConnectApi.NotFoundException: Resource not found. Class.ConnectApi.ChatterFeeds.getFeedElement: line 1502, column Class....
user avatar
  • 3,089
1 vote
1 answer
1k views

Create a Custom Chatter Stream from Apex ConnectApi

I love Chatter streams and how they allow me to combine and filter existing feeds. I would like to create such stream dynamically in Apex and found a ChatterFeeds.createStream(communityId, streamInput)...
user avatar
0 votes
1 answer
1k views

Files Connect: How to create SharePoint folder?

Business Use Case As accounts in Salesforce reach certain status then business wants new SharePoint folder to be created with same name and as users add files to that account then those files would ...
user avatar
  • 3,976