Page 1 of 1

Cannot retrieve Salesforce data

Posted: Sat Apr 04, 2015 11:55 pm
by John Goddard

Dear Appery

I have a newbie question.

I am trying to make a basic application which will read from Salesforce custom object and display the results

I have followed the appery Salesforce tutorial, but cannot get the app to retrieve data - specifically:

-When I use the Salesforce Query Service in Appery I CAN see data returning via the test button
-When I run my app in either the browser or mobile device, I CANNOT see data, it throws an error via debug which is "GET https://api.appery.io/rest/1/proxy/tu... 401 (Unauthorized)"

After much experiementation, I have determined the following:

-If I enable "echo" via the service, my app does retrieve data (but I believe echo is just static data from the time the query was run on in dev, so is no help)
-My issue sounds the same as https://getsatisfaction.com/apperyio/...

I think this is an issue to do with authorization / authentication / OAuth / proxy between Appery and Salesforce, but I am stuck.

Any help would be appreciated

Thanks

John


Cannot retrieve Salesforce data

Posted: Mon Apr 06, 2015 7:13 pm
by Egor Kotov6832188

Hello John,

I CANNOT see data, it throws ... 401 (Unauthorized)

You need to set header Authorization with token, or you will get 401 every time.


Cannot retrieve Salesforce data

Posted: Mon Apr 06, 2015 9:56 pm
by John Goddard

Hi Igor

In the header of my query service I do have the Authorization defined
Image

I also have all the Salesforce values defined in Salesforce_Settings
Image

The actual error I am receiving in browser debug is
0: {message: "Session expired or invalid", errorCode: "INVALID_SESSION_ID"}
errorCode: "INVALID_SESSION_ID"
message: "Session expired or invalid"

I can successfully query the service via the "test" option, so I assume my Salesforce settings must be correct.

Sorry if I am missing something obvious...

Any help greatly appreciated


Cannot retrieve Salesforce data

Posted: Mon Apr 13, 2015 6:28 am
by Alena Prykhodko

Hi John,

Sorry for radio silence here, we'll post an update as soon as possible.


Cannot retrieve Salesforce data

Posted: Mon Apr 20, 2015 2:27 pm
by Serhii Kulibaba

Hello John, where did you received session token, from the same app?


Cannot retrieve Salesforce data

Posted: Tue May 19, 2015 10:42 am
by John Goddard

Hi Sergly, I copied the example https://devcenter.appery.io/tutorials... word for word and have tested it via the web browser test option in Appery. So I assume I am receiving the session token from my app itself when I authenticate to Salesforce.

I would be interested to know if you are also able to get the example working as I have tried several times without success.

Sorry if I have made a simple mistake somewhere, but I am not able to see what I have done differently from the instructions...


Cannot retrieve Salesforce data

Posted: Fri May 29, 2015 9:19 am
by Alena Prykhodko

Hello John,

Hard to say then.
Please find backup of working app here https://drive.google.com/a/exadel.com...