Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce calling rest service using request api fails. #180

Open
vinodjoseph62 opened this issue May 11, 2016 · 0 comments
Open

Salesforce calling rest service using request api fails. #180

vinodjoseph62 opened this issue May 11, 2016 · 0 comments

Comments

@vinodjoseph62
Copy link

vinodjoseph62 commented May 11, 2016

I followed the steps to create an application in salesforce and added the client key and secret in oauthd dashboard . I am making an get access token call, which gives me a access token and refresh token.
Now I want to make rest api calls to salesforce using oauthd request apis. I am referring this document
[http://docs.oauth.io/#using-rest] to implement the rest api calls by providing the app key secret in parameter ' k ' and accesstoken as follows.
my oauthd server is configured as http://localhost:6284
this is the uri which I use to make rest api calls
http://localhost:6284/request/salesforce/services/data/v36.0/query/?q=SELECT Id, Name FROM Account WHERE AccountNumber = 'CE414794'

and these are the parameters which I pass
oauthio : k=_KEY&access_token=_token
The call fails with response as
{ "status": "error", "code": 500, "message": "too few args to sprintf", "data": { "code": "InternalError", "stack": [ "InternalError: too few args to sprintf", " at Server.<anonymous> (/usr/local/lib/node_modules/oauthd/node_modules/restify/lib/index.js:111:18)", " at emitMany (events.js:108:13)", " at Server.emit (events.js:182:7)", " at Domain.onError (/usr/local/lib/node_modules/oauthd/node_modules/restify/lib/server.js:792:18)", " at emitOne (events.js:77:13)", " at Domain.emit (events.js:169:7)", " at emitError (domain.js:65:24)", " at Domain.errorHandler [as _errorHandler] (domain.js:104:16)", " at process._fatalException (node.js:220:33)" ] } }

But when I make a direct call to salesforce without oauthd ( i use the same access token which I get from the oauthd server) , I get a success response and the user details . What might be the issue. Are these rest api's available for oauthd or is it not. If yes why do I get the above error, or the way in which we are making rest api calls incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant