Questions tagged [connect-api]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Update notification through connect notification api

I have been trying to execute a Patch request to /connect/notifications api by sending the following payload from developer console. But I get the response as Bad Request, error code 400. { "...
  • 85
0 votes
0 answers
19 views

Why would ConnectAPI temporarily throw "Insufficient Access" errors for a Customer Community User?

Have an odd scenario where a callout to ConnectAPI ChatterFeeds is temporarily throwing "Insufficient Access" errors when a User I log into via the "Login to Experience as User" ...
0 votes
0 answers
23 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....
0 votes
0 answers
25 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 ...
0 votes
0 answers
12 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 ...
0 votes
1 answer
98 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 ...
  • 191
0 votes
1 answer
396 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/...
  • 55
0 votes
0 answers
69 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,...
1 vote
0 answers
58 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 ...
2 votes
1 answer
418 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. ...
  • 23
0 votes
0 answers
50 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 ...
0 votes
1 answer
146 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: { &...
2 votes
1 answer
103 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....
8 votes
1 answer
937 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 ...
  • 208
2 votes
1 answer
290 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 ...
  • 3,122
2 votes
0 answers
62 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....
1 vote
0 answers
175 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 ...
2 votes
1 answer
161 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 ...
2 votes
0 answers
254 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 ...
3 votes
1 answer
180 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 ...
  • 63.7k
0 votes
1 answer
230 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 ...
0 votes
2 answers
1k 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 = ...
  • 2,146
1 vote
1 answer
864 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 ...
0 votes
1 answer
231 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
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 ...
2 votes
1 answer
152 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/...
  • 765
0 votes
1 answer
959 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 ...
  • 13.9k
0 votes
1 answer
261 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....
2 votes
0 answers
157 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> ...
  • 37
0 votes
0 answers
37 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 ...
0 votes
0 answers
339 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 (...
  • 1,099
0 votes
1 answer
1k 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 ...
  • 524
0 votes
1 answer
292 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 ...
2 votes
1 answer
44 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 ...
  • 88.2k
1 vote
0 answers
46 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 ...
  • 24.8k
1 vote
1 answer
861 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....
  • 321
1 vote
1 answer
183 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....
  • 321
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 = [...
  • 170
0 votes
1 answer
613 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 ...
  • 1
0 votes
0 answers
147 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 ...
  • 99
2 votes
2 answers
593 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"...
  • 1,712
0 votes
2 answers
911 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 ...
0 votes
1 answer
413 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 ...
  • 793
0 votes
1 answer
529 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 ...
  • 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, ...
  • 337
1 vote
1 answer
58 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 ...
  • 13
1 vote
0 answers
281 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>(); ...
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 ...
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....
  • 3,100
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)...