One Rest API for your Lifetime Salesforce Implementation with Flow Builder as Controller

Image1: OneRest is the default path name for your installed package, feel free to change it in the apex class (and test class) if you need to
Image2: Initial installed flow
Image3: Decision element, as your router based on path
Image4: How to return pong
Image5: Return error code 400 if no path found
Image6: Return 400 if no path found
Image7: Variables to process requests
Image8: Add new path to Router Decision
Image9: Parse Params JSON field country with MultipleJSONParser Action (value stored to QueryStringCountry)
Image10: Add Get Records Element and use parsed data as filter (country)
Image 11: Count total records found with Assignment Element
Image 12: Assign body,content-type, and status code for return
Image 13: Result
Image 14: Final flow for Spec GET CountAccounts based on country
Image 15: Add new decision in Router
Image 16: Use Multiple JSON Parser to parse Content-Type from headers and store to content_type variable
Image 17: Check is request JSON or not, if not return 400 status code
Image 18: Parse field NewStatus from RequestBody / payload
Image 19: check if there’s status field in payload / body or not (if not, return 400)
Image 20: Update Lead based on path2 to status from RequestBody
Image 21: Return result in JSON
Image 22: Result in workbench
Image 23: Final Flow

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store