- Sun Mar 24, 2019 8:51 am
#823513
I am trying to create new REST API with 3.3.4-community I cannot get it to work.
I followed the wiki
https://wiki.processmaker.com/3.0/Creat ... _Endpoints
I checked the webinar all seem fine.
https://drive.google.com/file/d/0B6j8mE ... 5fejg/view
plugin file (lawyerCrud.php) code
Rest end point file lawyerCrud/lawyerCrud/src/Services/Api/lawyerCrud/Sample.php
http://35.204.42.244/api/1.0/workflow/p ... new/qsdqsd
But I get the following result, I deleted the router.php to regenerate it, but always the same problem.
I followed the wiki
https://wiki.processmaker.com/3.0/Creat ... _Endpoints
I checked the webinar all seem fine.
https://drive.google.com/file/d/0B6j8mE ... 5fejg/view
plugin file (lawyerCrud.php) code
Code: Select all
<?php
G::LoadClass("plugin");
class lawyerCrudPlugin extends PMPlugin
{
public function lawyerCrudPlugin($sNamespace, $sFilename = null)
{
$res = parent::PMPlugin($sNamespace, $sFilename);
$this->sFriendlyName = "Lawyer CRUD";
$this->sDescription = "Crud the Lawyer database";
$this->sPluginFolder = "lawyerCrud";
$this->sSetupPage = "setup";
$this->iVersion = "1.1";
//$this->iPMVersion = 2425;
$this->aWorkspaces = null;
//$this->aWorkspaces = array("os");
$this->enableRestService(true);
return $res;
}
public function setup()
{
$this->registerMenu("processmaker", "menulawyerCrud.php");
}
public function install()
{
}
public function enable()
{
}
public function disable()
{
}
}
$oPluginRegistry = PMPluginRegistry::getSingleton();
$oPluginRegistry->registerPlugin("lawyerCrud", __FILE__);
Rest end point file lawyerCrud/lawyerCrud/src/Services/Api/lawyerCrud/Sample.php
Code: Select all
I user postman with the access token <?php
namespace Services\Api\lawyerCrud;
use ProcessMaker\Services\Api;
use \ProcessMaker\Util;
class Sample extends Api
{
/**
* @url GET /sample/new/:var
*/
public function newsample($var)
{
return $var;
}
}
http://35.204.42.244/api/1.0/workflow/p ... new/qsdqsd
But I get the following result, I deleted the router.php to regenerate it, but always the same problem.
Code: Select all
{
"error": {
"code": 404,
"message": "Not Found"
}
}