ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

RPC endpoint with parameter in path

Hi all,

is there a way to provide an RPC endpoint with a parameter in the path, like:

http://[myserver]/doted.path.to.function/{parameter}
and
http://[myserver]/doted.path.to.function/{parameter}/furtherPath/

There are some external services that requires such a path…

Thanks
DoCa

I don’t know if this has first class support but as a ‘hack’ you can use this.

  • create whitelisted function to handle response.
  • URL would be /api/method/dotted.path.to.function
  • You can still add parameters as you need at the end, you’ll have to parse them yourself from the request URL.
1 Like

Thank you for the tip. I will give it a try!

Hello @doca

Not too sure whether your request is invoked from an API or from the CLI? Nevertheless have a look at a tutorial I’ve written on parameters in specific from the CLI. I hope it’ll help in some manner. [Tutorial] Using cURL for REST and RPC API calls

Eugene, thanks for the link!

@ankush: your tip works like a charm!