Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Exteded Api Not Works Rate Topic   - - - - -

 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 04 January 2016 - 03:50 PM #1

Hello Community, 

 

Happy New Year 2016 .

 

Ref:  http://docs.cs-cart....i_extending.htm

 

i'm try extending Api using this link: but its not work .

 

 

step one :  as in document i created a app/Tygh/Addons/Tygh/Api/Entities/Things.php

 

step 2:  Write this code:

 

 <?php

namespace Tygh\Api\Entities;
 
use Tygh\Api\AEntity;
use Tygh\Api\Response;
 
class Things extends AEntity
{
    public function index($id = '', $params = array())
    {
        return array(
            'status' => Response::STATUS_OK,
            'data' => array('name' => 'vivek')
        );
    }
 
    public function create($params)
    {
        return array(
            'status' => Response::STATUS_CREATED,
            'data' => array('name' => 'vivek_gupta')
        );
    }
 
    public function update($id, $params)
    {
        return array(
            'status' => Response::STATUS_OK,
            'data' => array('name' => 'gupta')
        );
    }
 
    public function delete($id)
    {
        return array(
            'status' => Response::STATUS_NO_CONTENT,
        );
    }
}
?>
 
Step-3:  calling with 
 
try {
    $Entity = "Things";
    $Response = $cscartapi->get($Entity, $params);
    print_r($Response);
} catch (Exception $e) {
    print $e->getMessage();
}

 

Please help me , how we can extend Api with custom entities.

 

 


Vivek Gupta 
 


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 04 January 2016 - 03:51 PM #2

Reference Link is:   http://docs.cs-cart...._extending.html


Vivek Gupta 
 


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11384 posts

Posted 05 January 2016 - 07:20 AM #3

You create the Tygh path in the add-on directory. I.e. app/addons/my_changes/Tygh/....

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 05 January 2016 - 11:31 AM #4

 

 

Posted Today, 12:50 PM#3

You create the Tygh path in the add-on directory. I.e. app/addons/my_changes/Tygh/.... 
EZ Merchant Solutions: Custom B2B Development, Consulting, Development and Special Projects (get a quote).
Commercial addons and modifications to meet your business and operations needs.
  • 0
  •  
  • rep_up.png
  •  
  • rep_down.png

 

Thanks "tbirnseth"

 

i tried with making /app/addons/my_changes/app/Tygh/Api/Entities/Things.php  but its not works .

 

i getting this response "Not Found: The Entity Things not found".

 

Please suggest how to done it .   

 

Thanks


Vivek Gupta 
 


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11384 posts

Posted 05 January 2016 - 07:37 PM #5

I've not extended the API.  I simply read the first few lines of the documentation to correct your location since what you had definitely wouldn't be right.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19764 posts

Posted 06 January 2016 - 09:33 AM #6

The issue should be examined directly on your server. If you are interested, please pm me temporary FTP access


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 08 January 2016 - 04:36 PM #7

Thanks Ecom, :)

 

 

Whenever i feel some trouble definitely i will PM. 


Vivek Gupta 
 


 
  • abolshakov
  • Architect
  • CS-Cart Architects
  • Join Date: 20-Aug 14
  • 93 posts

Posted 10 January 2016 - 12:40 AM #8

Thanks "tbirnseth"

 

i tried with making /app/addons/my_changes/app/Tygh/Api/Entities/Things.php  but its not works .

 

i getting this response "Not Found: The Entity Things not found".

 

Please suggest how to done it .   

 

Thanks

 

Hello,

 

Looks like you're trying to use "/app/addons/my_changes/app/Tygh/Api/Entities/Things.php" path instead of the correct "/app/addons/my_changes/Tygh/Api/Entities/Things.php".


Alexander Bolshakov
CS-Cart Architect Team


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 10 January 2016 - 08:04 AM #9

 

Hello,

 

Looks like you're trying to use "/app/addons/my_changes/app/Tygh/Api/Entities/Things.php" path instead of the correct "/app/addons/my_changes/Tygh/Api/Entities/Things.php".

 

 

Thanks   abolshakov  :)

 

i'll try it once more.


Vivek Gupta 
 


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 12 January 2016 - 03:06 PM #10

Sorry , I tried it , but its not work for me.  :D


Vivek Gupta 
 


 
  • sks1990
  • Newbie
  • Trial users
  • Join Date: 20-Jan 17
  • 3 posts

Posted 20 January 2017 - 06:54 AM #11

Enable(Active) the my_changes ondons for admin panel



 
  • sks1990
  • Newbie
  • Trial users
  • Join Date: 20-Jan 17
  • 3 posts

Posted 20 January 2017 - 06:56 AM #12

Enable(Active) the my_changes addon in admin panel.