
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2020 05:22 AM
I want to build a component to retrieve data but the rest api requires some parameters to be passed as json in the request body.
I am looking at the documentation for createHttpEffect and I cannot figure out how to send a json body with the request.
Does anybody know what parameters this should be passed in?
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2020 02:09 PM
Hi Tommy,
I'll do a little digging and see if I can find something outside of the docs on developer. That being said, one of the things we demonstrated on last week's shows was using a Flow Designer action to consume an external API, then calling that action from a scripted rest API, and consuming the SRAPI from our component. That way we can abstract things from the component a bit and do any heavy lifting in the SRAPI. If you are looking to consume an external API from your component, that might be an architecture to look at either way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2020 01:48 PM
This is the right answer on how to form the body. dataParam will contain the request body, and you have to pass it an object that's value is the JSON object body.
Don't do this, it will not work:
dataParam: {
status: "requested",
user: properties.user.value,
start_date: properties.startDate,
end_date: properties.endDate
}