Invalid Parameter : Custom Endpoint

I am new to sugarCRM
I had created a custom module(source IP) called order and its working fine. And I had created a custom API for the order module and I exposed that endpoint to different application in different server. The API was tested using Postman and was working fine. Whenever application (destination ip) hits order API in sugarCRM.,SugarCRM is throwing invalid parameter(error code 422) .
Below is the response
{"error":"invalid_parameter","error_message":"A parameter in your request was invalid." }
Version used is 10.3 (Enterprise)

How to solve this problem ?

Parents
  • Can you share the content of method registerApiRest for that custom api? Also you can share the url external api is calling?

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Hi André Lopes,

    Thank you for your reply.
    Below is my url and registerApiRest method

    URL :  http://{{URL}}/sugarcrm/rest/v10/Ord_Orders/UpdateOrderMethod

    Method :

    public function registerApiRest()
        {
            return array(
                'MyGetEndpoint' => array(
                    //request type
                    'reqType' => 'PUT',
    
                    //set authentication
                    'noLoginRequired' => false,
    
                    //endpoint path
                    'path' => array('Ord_Orders','UpdateOrderMethod'),
    
                    //endpoint variables
                    'pathVars' => array('', ''),
    
                    //method to call
                    'method' => 'UpdateOrderMethod',
    
                    //short help string to be displayed in the help documentation
                    'shortHelp' => 'updating an order in SugarCRM',
    
                    //long help to be displayed in the help documentation
                    'longHelp' => './custom/modules/Ord_Orders/clients/base/api/help/CreateOrder.html',
                ),
            );
        }

Reply
  • Hi André Lopes,

    Thank you for your reply.
    Below is my url and registerApiRest method

    URL :  http://{{URL}}/sugarcrm/rest/v10/Ord_Orders/UpdateOrderMethod

    Method :

    public function registerApiRest()
        {
            return array(
                'MyGetEndpoint' => array(
                    //request type
                    'reqType' => 'PUT',
    
                    //set authentication
                    'noLoginRequired' => false,
    
                    //endpoint path
                    'path' => array('Ord_Orders','UpdateOrderMethod'),
    
                    //endpoint variables
                    'pathVars' => array('', ''),
    
                    //method to call
                    'method' => 'UpdateOrderMethod',
    
                    //short help string to be displayed in the help documentation
                    'shortHelp' => 'updating an order in SugarCRM',
    
                    //long help to be displayed in the help documentation
                    'longHelp' => './custom/modules/Ord_Orders/clients/base/api/help/CreateOrder.html',
                ),
            );
        }

Children
No Data