Access a route in php code

need to simply access one of my api_Actions from a rowupdated() event - doesn’'t need to pass parameters, not exactly sure how to set the parameters… nothing happens.not sure what the 2nd parameter is suppose to be

    public function rowUpdated($rsold, &$rsnew)
    {
        global $app;
     
        $app->get('/renderFaxPreview','\renderFaxPreview:12345');
    }



$app->get('/renderFaxPreview'/{x_id}, function ($request, $response, $args) 
{
    DO SOMETHING...       
    $response = $response->write($result);
    return $response; 
 });

If you want to access an API action on the server side, you should use server side client such as cURL. PHPMaker has a function called ClientUrl(), you may use it like:

$result = ClientUrl("/myBasePath/api/renderFaxPreview/myID");

what do you mean by the MyBasePath portion ?, will i need to create a separate file to utilize the ClientUrl. currently the renderFaxPreview is a event in the Api_Action()thanks.

sticcino wrote:

what do you mean by the MyBasePath portion ?

It depends on the setup of your site. If your site is at http://www.mycompany.com/myBasePath/, you need to include the base path in the URL. Actually you need to use full URL for ClientUrl() like:

$result = ClientUrl(FullUrl("/myBasePath/api/renderFaxPreview/myID"));

understood, got it working, thanks!