Have 2 methods within same new endpoint

Hello there,

Is it possible to have 2 method within the same endpoint file?

I have followed the tutorial:

http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/API/Web_Services/Extending_Web_Servi…

But I would like to have more than one method (get, post, put) within one file,

please advise, thanks!!

  • Hello,

    You can use multiple methods within the same point but you have to put some condition over there to handle multiple methods.

    For ex:

    <?php

    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
     
    ... handle form submission here ...
    }

     

    if ($_SERVER['REQUEST_METHOD'] == 'GET') {
     
    ... handle form submission here ...
    }

     

    if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
     
    ... handle form submission here ...
    }

    ?>

  • Hey thanks!!

    But from the example:

    http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/API/Web_Services/Extending_Web_Servi…

    Line 24:

    //method to call
       'method' => 'MyGetMethod'

     

    we have to registered the method, how can we have 3 method registered?

     

    Please advise, Thanks!!

  • 강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑

  • 강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑강남풀싸롱예약→『 olo 2694 2563 』강남야구장 ↗역삼야구장↘매직미러초이스◑

  • Hello,

    You can register only one method at a time. No way to register multiple method at once. You can handle multiple logic into one method.