Create arbitrary POST request #110

Open
pchittum opened this Issue Feb 26, 2016 · 5 comments

Projects

None yet

4 participants

@pchittum

As the salesforce api continues to expand, it might be useful to create a way for nforce to make an arbitrary POST request while waiting for specific features to be supported.

Use Case: POST to generic streaming API channel.

This requires making an HTTP POST request to

/services/data/v36.0/sobjects/StreamingChannel/{channelId}/push

(where {channelId} is the salesforce ID for the generic channel).

I was able to get this to work, but I ended up using the should-be-private _apiRequest method. I would much rather have a way to make a POST pre-packaged in the same way that getUrl is made available for arbitrary HTTP GET requests.

I am crazy busy for the next month. If I can get back to this later, I might have a stab and make a PR. But if I post this here, maybe someone else will have a go first.

Thanks! Great lib, by the way!

@kevinohara80
Owner

@pchittum @afawcett I've got vacation next week so I could probably add this...unless someone else wants to submit the PR. :)

@pchittum
pchittum commented Jun 3, 2016

I won't have time for anything for while. If I find time Ineillcheck with
you before I dive in.

On Friday, 3 June 2016, kevinohara80 notifications@github.com wrote:

@pchittum https://github.com/pchittum @afawcett
https://github.com/afawcett I've got vacation next week so I could
probably add this...unless someone else wants to submit the PR. :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#110 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABE1xKpJK1uERrxoqvCj9eWcdlb349plks5qIFPXgaJpZM4HjvUy
.

Peter Chittum
Director, Developer Evangelism EMEA
+44 7786 515 531
@pchittum
Sent from Gmail Mobile

@jkentjnr
jkentjnr commented Nov 24, 2016 edited

@afawcett I created https://github.com/jkentjnr/nforce-actions and have only added support to date for flows:

const org = nforce.createConnection({
  clientId: '<client_id>',
  clientSecret: '<client_secret>',
  redirectUri: '<redirect_uri>',
  username: process.env.SFUSER,
  password: process.env.SFPASS,
  plugins: ['customActions'] // loads the plugin in this connection
});

org.customActions.runFlow({ flow: { name: 'Test_Flow', params: { } }, oauth }, (err, response) => {
    console.log('RESP', err, response);
});
@afawcett
afawcett commented Dec 4, 2016

Nice thanks @jkentjnr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment