function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

REST api is not working

HI EveryBody,

Iam working on iphone sfdc integration.

I created custom login page to get the user access_token and and using that i get user profile info upto this it is fine.

But when iam querying object fields using restapi iam not getting respnse .

below is my query

SFRestRequest *request = [[SFRestAPIsharedInstance]requestForQuery:[NSStringstringWithFormat: @"SELECT ParentId,Id, PostCount, LikeReceivedCount FROM ChatterActivity"]];

[[SFRestAPIsharedInstance] send:request delegate:self];

Is this because of custom login?

iam not using oauthCoordinator OAuthCredentials in customlogin because iam sendin my username and password to


With nativeapplication template REST API working fine.iam getting response in native application with Here for login we use salesforce webview.we when we press login it will use SFOAuthCoordinator SFOAuthCredentials.

SFRestRequest *request = [[SFRestAPIsharedInstance]requestForQuery:[NSStringstringWithFormat@"SELECT ParentId,Id, PostCount, LikeReceivedCount FROM ChatterActivity"]];

[[SFRestAPIsharedInstancesend:request delegate:self];

I also tried to get the query details of the object with url -H "Authorization: OAuth <myaccess_token>" -H "X-PrettyPrint:1

iam getting the fallowing error


<message>Session expired or invalid</message>
please help me.......
Thanks in Advance.
Sandeep kumar


The REST API requires you to authenticate via OAuth, specifically to populate an access token which is included in the HTTP header. SFOAuthCoordinator is the trick.




thanks for your reply


How can i authenticate via Oauth with my custom login page???


Thanks in advance,

sandeep kumar