• Thomas Cook
  • NEWBIE
  • 54 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 22
    Replies
I'm using Session ID + URL in connection with the RESTful API of Salesforce.  Is there any way to get the User ID of the user via the REST interface?

Please note, I'm not using oAuth so all the answers that say "when you autenticate via oAuth you get a Idenity Service URL" don't work for me since I don't get that URL.  Also, that URL includes the User ID so if I was able to generate it, then I'd already know the information I needed to kow.

Unless someone can explain otherwise, the Idenity URL is unavailable to me unless I can figure out the User ID:
https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_using_openid.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_using_openid.htm&language=en_US)

We're using the Chatter API and pulling a feed into our application.

 

We are retrieving the image URL from the Chatter API feed response and attempting to display it in the web app.  The detail from our HTTP XHR traffic analyzer is showing a 302 Found HTTP response but the following message is also showing and the profile photo of each user is missing,

 

Resource interpreted as Image but transferred with MIME type text/html: "https://na8.salesforce.com/content/session?url=https%3A%2F%2Fc.na8.content.force.com%2Fprofilephoto%2F729C0000000DXXXXX".

 

The login to the SFDC site/portal itself is timedout but we refresh the API token for the Chatter API calls and the photos don't show.

 

Can anyone offer an explanation for why this is happening? Or what the solution might be? 

I'm using Session ID + URL in connection with the RESTful API of Salesforce.  Is there any way to get the User ID of the user via the REST interface?

Please note, I'm not using oAuth so all the answers that say "when you autenticate via oAuth you get a Idenity Service URL" don't work for me since I don't get that URL.  Also, that URL includes the User ID so if I was able to generate it, then I'd already know the information I needed to kow.

Unless someone can explain otherwise, the Idenity URL is unavailable to me unless I can figure out the User ID:
https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_using_openid.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_using_openid.htm&language=en_US)

We're using the Chatter API and pulling a feed into our application.

 

We are retrieving the image URL from the Chatter API feed response and attempting to display it in the web app.  The detail from our HTTP XHR traffic analyzer is showing a 302 Found HTTP response but the following message is also showing and the profile photo of each user is missing,

 

Resource interpreted as Image but transferred with MIME type text/html: "https://na8.salesforce.com/content/session?url=https%3A%2F%2Fc.na8.content.force.com%2Fprofilephoto%2F729C0000000DXXXXX".

 

The login to the SFDC site/portal itself is timedout but we refresh the API token for the Chatter API calls and the photos don't show.

 

Can anyone offer an explanation for why this is happening? Or what the solution might be? 

Hi There,

 

I have been playing around with the SDK and have managed to get the RestClient up and running without any issues so I can query Salesforce directly quite easily.

 

I now want to try and send / receive chatter posts using the REST API for chatter but with no success. So to ask what may well be a obvious question, in relation to the line:

 

OAuthTokens myTokens=globalState.getAccessTokens();

 

Where is the OAuthTokens class and how does the globalState object get created. I cannot seem to figure this out but I am sure it is something simple. Even when I am already authenticated through the RestClient I cannot seem to get a token object from the connection.

 

I can do this through java just using http calls and a browser but have struggled on Android.

 

Any assistance is greatly appreciated.

 

I am trying to download a file attached to a chatter feed. Barring extensions and other naming issues, there is an interesting problem:

 

I get a fresh OAuth access token from the stored refresh token, but every time I try to download the file I get a 401 response containing

 

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

 

Does anyone have had a similar issue? How can I unblock this? I have read the other messages regarding this but the proposed solutions (if any) do not work for me.

 

This is the command I use to download the file

 

curl -v https://na9.salesforce.com/services/data/v25.0/chatter/files/069E0000000UylDIAS/content -H "Authorization: OAuth xxDExxxxxxxxZCxx%21ARsAQGWxOZVEP.GemGLJ.PTYPGdVxcynRHBB9ExtYCxhgD1UJ6kFR_yVPqOofFZvLEmqxeXMtgXqBVxzvxGGqP_dAPxEvNlx"

 

(I've tried "Bearer" instead of "OAuth" in the auth header, as it's the word I use for the REST API, but the result is the same)

 

(some numbers and letters have been changed to "x" in the token, to protect it. It will expire in any case)

 

 

Thanks to everyone!

 

 

This is an intermittent problem but occurs more frequently now...

 

I am making calls to Chatter REST API to obtain feed items

 

https://na12.salesforce.com/services/data/v24.0/chatter/feeds/company/feed-items

 

and passing the OAuth access token in the HTTP header.  When the token is null I obtain a new access token.

 

The call to obtain a new access token always seems to work, but the subsequent call to get the feed items frequently fails with the (503) Server Unavailable message.

 

Why would the call fail intermittently?

Using the Chatter REST API from Apex... when I request feed items for a case record using Apex code that looks like the below...

 

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(this.server +  '/services/data/v23.0/chatter/feeds/record/' + caseId + '/feed-items');
request.setMethod('GET');
request.setHeader('Authorization', 'OAuth ' + this.sessionId);
HttpResponse response = http.send(request);

 

In the JSON results, I am only getting the last page of the feed items and the nextPageUrl is always null.

 

If I append a '&pageSize=100' to the URL then I can get all of the feed items up to 100, but again I only get 1 page of results.

 

In one of my requests, I actually saw the "nextPageUrl' having a non-null value: this was once when I was not using the pageSize URL parameter, but it was intermittent.  Not sure why it showed me a value for just one call.

 

What I want to do is to be able to make multiple requests to get the first page, and then the second page, etc.

 

Does anyone have an example of Apex code that should work?  Or any clues on what I might be doing wrong?

 

Hi Guys,

 

I'm having a problem downloading attachments using Chatter Rest API. When I tried to get the feed item response I get the download URL and used the url for my download. I'm having an error SESSION is invalid. What I want is get the attachments link and view it in my browser page. 

The Chatter REST API gives me back the ID for objects and the URL of the REST endpoint for the object, but I would like to include, in my UI, links back to the original SalesForce pages for the object. 

 

I can do this for users by linking to instanceURL + UserID, which redirects me to <<instanceURL>>/_ui/core/userprofile/UserProfilePage for that user, which is perfect. 

 

But I’ve not found a way to use the information in the feed-item object to build up a URL for the single item view of the feed-item itself.  Any ideas?

  • October 17, 2011
  • Like
  • 0

So the problem im having is when a user on my applicaiton clicks to download a file attached to a chatter post it prompts them to login. is there a way to add the session id or oauth token to the request to allow the file to be served the file to people.

 

We have .NET .We want to securely access Salesfore Chatter API through application.

We want to enable SSL on .NET site.

Wanted to know the exact steps for it and Do we require any SSL Certificates at Client(.NET) or Server (Salesforce

Side)

Please advise as soon as possible.

We have .NET .We want to securely access Salesfore Chatter API through application.

We want to enable SSL on .NET site.

Wanted to know the exact steps for it and Do we require any SSL Certificates at Client(.NET) or Server (Salesforce Side)

Please advise as soon as possible.

I'm trying to enable 'Like' functionality in my app using the iOS toolkit. The code I'm using is as follows:

 

 

-(void) like:(NSString *)messageId {
    ZKSObject *like = [[[ZKSObject alloc] initWithType:@"FeedLike"] autorelease];
    [like setFieldValue:messageId field:@"FeedItemId"];
    
    FDCServerSwitchboard *switchboard = [FDCServerSwitchboard switchboard];
    NSArray *objects = [NSArray arrayWithObject:like];
    [switchboard create:objects target:self selector:@selector(likeCreated:error:context:) context:nil];
}

 The error message I'm getting is:

 

<__NSArrayM 0xd9454b0>(

INVALID_TYPE - sObject type 'FeedLike' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

)

 

Is there something else I need to do to get "Likes" working?

 

 We are using REST API to upload file to Chatter from .net application

/chatter/feeds/news/me

 

We are getting error 401 UnAuthorized..

 

Please advise