Gravatar for

Question by tzavertnik, Sep 11, 2018 7:32 PM

Generic REST API Source - Obtain Security Token by pass parameters through body

We are trying to leverage the Generic REST API Source to connect to a 3rd party API that requires one call to login and another to execute a query to return specific data via the body through the POST method. In documentation that I have read, there is the ability to define headers via a node in the EndPoints node but the body node is reserved to match the response to a field in Coveo.

So through Postman, I would pass the following json in the body to filter the values based on a start and end date.

"searchOptions": {
"startDate": "2018-09-01T15:28:18.011+0000",
"endDate": "2018-09-09T15:28:18.011+0000"

How would I pass this via the JSON configuration for the Generic REST API Source? Any help or direction is greatly appreciated. Thanks.

1 Reply
Gravatar for

Answer by François Lachance-Guillemette, Sep 11, 2018 8:29 PM

A pass through the documentation Generic REST API Source Reference provided me with the `PayloadParameters` option that you can set in your endpoint configuration.

The documentation states:

Key-value list of HTTP parameters to add to the payload. Each key must be a string, while the value can be either a number, string, or Boolean.

This property can only be used in a POST request. The parameters are sent as URL-encoded data in the request body.

Have you tried using this option?


I also would like to draw your attention to another type of source, Push API Source. For more complex scenarios that cannot be handled with the Generic REST API Source, you can create a simple client that would transform your endpoint's data to the Push API format push the data into this source instead.

It is not necessarily a better option, the Generic REST API works really well, but I wanted to share it in case you didn't know about it.

Hope this helps!

Gravatar for

Comment by tzavertnik, Sep 11, 2018 9:37 PM

I found that parameter and gave it try but I am still running into issues. If I wanted to speak with someone in support to walk through in more detail who/how would I contact to setup a call/session?

Ask a question