Questions tagged [connect-api]

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

38 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
261 views

How can we update profile picture of user on onCreateUser()?

I use ConnectApi to modify picture of User in custom salesforce login (Facebook, Twitter...), as follows: global void updateUser(Id userId, Id portalId, Auth.UserData data){ ... ConnectApi....
3
votes
0answers
358 views

References to URLs returned by Apex ConnectApi in Salesforce1 mobile

I have a VF page that I am using as an inline page on the Opportunity detail page layout. It retrieves and displays files (FeedItems with ConnectApi.ContentCapability) from Chatter feeds on records ...
2
votes
2answers
182 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"...
2
votes
0answers
132 views

dashboard component snapshot via code

Is there a way to take snapshot of a dashboard component and get the url of the image, all via code? I tried to use ConnectApi.DashboardComponentSnapshot, but i get error saying i can't construct a ...
2
votes
0answers
167 views

Push Notification for Chatter Group not Working

I am using chatter group and implemented the Push Notification using ConnectApi.ChatterFeeds.postFeedElementBatch(Network.getNetworkId(), chatterPosts), but the push notification is not working. Now ...
2
votes
0answers
163 views

ConnectAPI updateFeedElement with new mention in trigger double email

I'm coding a trigger for "FeedItem" to automatically add a mention to a certain user. I'm following pretty much the same logic stated here (by adding a new mention segment to the feed input): https:/...
2
votes
0answers
342 views

Only user and group IDs may be used in inline mentions

I'm creating Chatter feed items using connect API apex. I want a simple message that contains a link to the user and a related object, e.g. opportunity. I'm getting this message when running the code ...
2
votes
0answers
2k views

Chatter in APEX (Connect API) with VF: Best practices to avoid limits

I am currently working on using "Chatter in APEX" aka ConnectApi to display feeds from custom object records in a Visualforce page. I am using one VF page with links that re-render the same page but ...
1
vote
0answers
24 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 ...
1
vote
1answer
38 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 ...
1
vote
0answers
187 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>(); ...
1
vote
0answers
135 views

How to query/fetch public feed elements in a community to which the user is not subscribed?

Use Case Display a list of all public questions and posts to a community user, regardless of whether or not that user is subscribed to the groups or users who posted. What we've tried SOQL query ...
1
vote
1answer
82 views

Is it impossible to test code that calls the connectapi as a community user?

My test class currently includes the code from here only, with the exception described below: https://developer.salesforce.com/page/Apex_Testing_with_RunAs I've added this line of code just above the ...
1
vote
1answer
104 views

connectapi follow a post on chatter

How can I create a link on a visualforce page that when I click it, it will follow that that post using the connectapi Also how can I display the posts that I follow using the connectapi
1
vote
0answers
160 views

seeAllData = false vs. ConnectApi

I have a trigger on FeedItem that auto-tags a topic. It does so by creating a TopicAssignment record and inserting it via DML. The problem is that I am getting a gack if I attempt to auto-assign a ...
1
vote
0answers
230 views

Upload New Version file to chatter feed through Connect API

I am trying to use "upload a new version" functionality for files in chatter through Connect API in my VF page.I am not getting any proper solution to implement it. Please suggest how I can do it ...
0
votes
0answers
16 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
0answers
97 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 (...
0
votes
0answers
48 views

ConnectApi.UserProfiles.setPhoto doesn't update automatically the photo

When the user upload the photo, we don't have it available right after the upload, taking a very little time. The problem is, when the user upload the photo, the Lightning component receive the ...
0
votes
1answer
113 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....
0
votes
0answers
44 views

Change FeedItemPost CreatedById using ConnectApi

I want to post chatter items via Apex with a link attached and an @ mention. I've been able to figure out how to attach the link and @ mention through research. The next step to finishing this is to ...
0
votes
0answers
22 views

External Data source with third application with salesforce Connect

I want to connect an external database with salesforce. I have seen examples: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_examples.htm So I have some ...
0
votes
0answers
53 views

Not able to upvote/downvote from Community user

We have created a community of type customer service, in which we have customized chatter functionality with custom UI, using ConnectApi, while we are able to perform other operations, but we are not ...
0
votes
0answers
32 views

Group mention is not working with custom chatter functionality

I am using the Connect API to create a custom feed. This is working fine when I am using user in @mention but when I am using the group in @ mention it is not doing the feed post an exception is ...
0
votes
1answer
177 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 ...
0
votes
0answers
52 views

How to use customFilter in ConnectApi.ChatterFeeds.getFeedElementsFromFeed?

Does anyone know how to use custom Filter getFeedElementsFromFeed for case feeds in Salesforce? I use getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, ...
0
votes
0answers
51 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 ...
0
votes
0answers
26 views

Is EntityLink available from a Partner Community context?

Does anyone know if EntityLink can be used in chatter message in Partner Community context? Invoking the command below: ConnectApi.ChatterFeeds.postFeedElementBatch(networkId, listOfFeedElements); ...
0
votes
1answer
125 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 ...
0
votes
1answer
158 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 ...
0
votes
0answers
16 views

Can anyone point me in the right direction if its possible to get object values form a .net website into salesforce

Can anyone point me in the right direction if its possible build a webservice to get object values form a .net website into salesforce. If there are articles which explain this topic and if it ...
0
votes
1answer
127 views

Only the first image is getting displayed Onload function

I have a custom visualforce page that mimics the functionality of a chatter group in Salesforce. For each post with an attachment, I am trying to show image icon as the attachment to download in the ...
0
votes
1answer
65 views

Trending Chatter posts

I am creating a chatter based custom application and wants to display Trending chatter posts based on the activity around that Post (Likes, Comments etc.) I couldn't find any Method/API exposed by SF ...
0
votes
1answer
79 views

How to use ConnectApi in a VF page having readOnly=“true” attribute?

I've a VF page which have readOnly='true' attribute and I am trying to implement a button that when clicked will make a chatter post with some Blob content as element attachment using ConnectApi ...
0
votes
2answers
120 views

how to like chatter comments

How can I use the ConnectAPI to like a chatter comment? I'm looking at the likeFeedItem method in the ChatterFeeds class. How do I get the FeedItemId? I'm not seeing a method to get the FeedItemId? ...
0
votes
0answers
923 views

Sending Chatter Private Message using Apex Trigger/Class

Need to send a Chatter Private Message to the current user whenever they post something inappropriate on the chatterfeed. I've already got the code to send the message through Apex, but it is ...
0
votes
1answer
191 views

How to post to Chatter Answers Community using code

I'm building a custom look/feel for Chatter Answers Community by pulling questions and replies and I'm now at a point where I have to implement users posting replies on this custom front-end I've ...
0
votes
0answers
116 views

Getting collection of chatter answers and their replies - getting null question objects

I'm trying to get a collection of chatter questions and their related replies, but for some reason, I'm getting the correct replies, but null values for the question object. Here's my code: public ...