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 Streaming API Functionality #92

Closed
tabirkeland opened this issue Apr 7, 2016 · 6 comments
Closed

Salesforce Streaming API Functionality #92

tabirkeland opened this issue Apr 7, 2016 · 6 comments

Comments

@tabirkeland
Copy link
Contributor

Currently working on integrating the Salesforce Streaming API into an application. Having to use node.js server with redis pub/sub.

https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

It would be amazing to have functionality for this built into this package.

Here is the npm package I am using to implement this:
https://github.com/kevinohara80/nforce

@omniphx
Copy link
Owner

omniphx commented Apr 11, 2016

Hi @tabirkeland,

I would love to eventually incorporate the Streaming API into this project. However, lately I've been a little pre-occupied with some other projects. So not sure when my timeframe would be to have this developed.

If you'd like, feel free to give it a crack and I'll be happy to provide some guidance. Forrest is leveraging the Guzzle library for HTTP requests. Looks like they have some good documentation on using streaming request: http://docs.guzzlephp.org/en/latest/request-options.html#stream

@tabirkeland
Copy link
Contributor Author

tabirkeland commented Apr 14, 2016

@omniphx Sounds great, I have been busy as well so if I do have time, I would love to take a swing at it.

Thanks for your reply.

On a side note, I utilize your UserPassword flow and a great way to keep a application authenticated is by using middleware as such:

<?php

namespace App\Http\Middleware;

use Forrest;
use Closure;

class ValidateSalesforceToken
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        // Look for the salesforce api session tokens
        if (!$request->session()->has('forrest_token')) {
            // Authenticate
            Forrest::authenticate();
        }

        return $next($request);
    }
}

@omniphx
Copy link
Owner

omniphx commented Apr 15, 2016

Me gusta! 👍

@tabirkeland
Copy link
Contributor Author

Just an FYI for what the streaming API can and cannot do:

https://resources.docs.salesforce.com/sfdc/pdf/api_streaming.pdf

Search for Unsupported PushTopic Queries

@tabirkeland
Copy link
Contributor Author

No longer an issue, possibly an enhancement in the future.

@formigone
Copy link

@omniphx any updates?

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

3 participants