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.
How would I pass this via the JSON configuration for the Generic REST API Source? Any help or direction is greatly appreciated. Thanks.
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!