Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By yasiralqaisi
#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
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
<?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;
    }
}
I user postman with the access token
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"
    }
}
By yasiralqaisi
#823543
It work now the error was plugin folder name in src/Service/Api/lawyerCrud/Sample.php
the first letter for the folder lawyer crud need to be upper case, its not mentioned in the wiki.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]