Ricky - Hi, Have a good weekend!I wish all mem...
Hi, Have a good weekend!
I wish all members success in their business.
I would like to ask for help with a problem I encountered in my development project.
If the path setting of Rest API is set to api/get/:id, I would like to ask for help if anyone knows how to fetch and retrieve data corresponding to id.
The database is postgresql.
Thanks.
Solution:Jump to solution
Hi @Ricky, For the path variable (parametrized request) - you can indeed include a path variable in the REST API trigger on Buildship, you can define a dynamic part of the path using a named parameter (often called a wildcard or path variable).
Here's how you can set this up: In the REST API trigger configuration, you specify the Path and Method. For dynamic paths, you can use a named parameter by prefixing it with a colon. For instance:
Path: /api/call/:id
if a request is made to a URL like - https://6dk2jv.buildship.run/api/call/:123 , the workflow associated with this path will be triggered. The variable part, 123, is captured by :id.
You can access/retrieve this variable within your workflow using the request.path object. To extract the conversationId from the path, you could use the following expression within your workflow's expression editor: request.path.split('/')[3]
This will retrieve the conversation ID from the path, which in your example would yield 123....BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
5 Replies
Solution
Hi @Ricky, For the path variable (parametrized request) - you can indeed include a path variable in the REST API trigger on Buildship, you can define a dynamic part of the path using a named parameter (often called a wildcard or path variable).
Here's how you can set this up: In the REST API trigger configuration, you specify the Path and Method. For dynamic paths, you can use a named parameter by prefixing it with a colon. For instance:
Path: /api/call/:id
if a request is made to a URL like - https://6dk2jv.buildship.run/api/call/:123 , the workflow associated with this path will be triggered. The variable part, 123, is captured by :id.
You can access/retrieve this variable within your workflow using the request.path object. To extract the conversationId from the path, you could use the following expression within your workflow's expression editor: request.path.split('/')[3]
This will retrieve the conversation ID from the path, which in your example would yield 123.
Sample Remix you can use - https://buildship.app/remix/c060337f-549c-4ec6-b992-68fd8d38f854BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
thanks.
but i couldn't do it, as this way
in fetching data node, there is not 'request.path'
This won't work in test
You need ship your workflow and make request to the endpoint with path variable
thanks.
thanks.
this platform is very simple and convenient