Gravatar for debadyuti.sil@gmail.com

Question by Deb, Sep 13, 2014 2:18 PM

How to Configure Endpoint for multiple Coveo Account?

Hi, I am new in coveo and created one coveo account using 'cloud.coveo.com' .I am using default endpoint as I have installed managed package in salesforce.How can i customize endpoint to get data for other coveo account which are connected to other sfdc org.Is there any way to get rid of this default endpoint?

I hope i need to use below code:

// Use this code to use a cloud index Coveo.Rest.SearchEndpoint.configureCloudEndpoint('OrganizationName');

        // Use this code to use an on-premise index
        Coveo.Rest.SearchEndpoint.configureOnPremiseEndpoint('http://server:8080/Coveo/Rest');

        // Use this code to use a custom endpoint
        Coveo.Rest.SearchEndpoint.endpoints["default"] = new Coveo.Rest.SearchEndpoint({
          restUri: 'http://server:8080/Coveo/Rest'
        });

**If this is correct a bit of explanation will be great help.

Gravatar for pastjean@coveo.com

Comment by pastjean, May 6, 2015 10:06 AM

Please not that /Coveo/Rest doesnt work anymore!

use "/rest/search" endpoint

1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Sep 14, 2014 4:14 PM

The most common scenario is to have your Salesforce organization bound to only one Coveo organization. I'm guessing that's what you want to achieve. You can link your Salesforce organization to a different Coveo organization by loading the /apex/CoveoSolutions__CoveoLinkToCoveoCloud page inside your Salesforce organization (use the appropriate instance hostname). This is a standard OAuth2 handshake where you'll have to log into your Coveo org to approve the operation. After doing that, the generated JS you copied will point to the new Coveo organization.

A more complex scenario would be using several Coveo organizations inside your SF org. To achieve this you'd need to obtain separate OAuth2 tokens and use them in Apex code to retrieve the per-user expiring "search tokens" that are automatically included for the default endpoint in the search page. You'd then configure multiple endpoints, and bind those to different Tab components. Although totally supported, it's not what I'd call a simple setup, so I won't describe it in details right now. Note that the complexity comes for security purposes since you can't have an all powerful OAuth2 token included in JS code sent to end-users.

Gravatar for debadyuti.sil@gmail.com

Comment by Deb, Sep 14, 2014 4:25 PM

The second scenario : binding multiple coveo accounts in single sf instance is that what i am looking for.I would like to make a dynamic rest call to different endpoint and get the response.I would like to learn this configuration of endpoint setup and playing with different access token i.e Oath2 with Coveo.It will be great help if you can suggest e any document or guidelines for that.

Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, Sep 15, 2014 3:07 PM

I'm curious to know why you'd want to do that. It is possible to index content from multiple SF orgs inside the same Coveo org (as well as many other sources), so why'd you want to maintain several orgs?

Ask a question