-2

I have just installed opencart and now I want to create restful custom API for my opencart store to get used by y android developer.

Version OPENCART 3.0.2

But I am new to API and I do not know what to where to do and what needs to be shared with my android developer, can some one please help me with the perfect tutorial where I can learn and implement this thing. I am trying to search the details on google. I have found this link

https://code.tutsplus.com/tutorials/explore-rest-apis-in-opencart-20-part-one--cms-25122

But it is not written any where that what I will give to my android developer so that he can use my API I have not started yet. My store is fresh please help me with end to end steps if someone knows.

Thanks

Amit Vyas
  • 1
  • 2

2 Answers2

0

Opencart provides a simple REST API although it's probably not advance enough to match your app requirements but you can get an idea about how to write your API. Opencart's API can be found here: Catalog/controller/api

For using the API you have to login first. In order to login simply send a post request to

Yoursite.yourdomain/index.php?route=api/login

Please note that you need to send a username and a key in your post request.

You can set the username and key in admin/system/users/api

Mathemagician
  • 431
  • 4
  • 13
  • yes I hav found the files, thank you but what I need to do with them, could you please let me how my android developer can us these files as API? – Amit Vyas Aug 23 '17 at 18:06
  • please check this screenshot for your reference which I have attached with my question – Amit Vyas Aug 23 '17 at 22:23
  • I've edited my answer but please note that opencart API provides very limited features and you probably need to expand it if you are going to use it – Mathemagician Aug 24 '17 at 07:38
0

enter image description here

Please check the image and let me know what needs to be done.

Amit Vyas
  • 1
  • 2
  • There's an 'AND' missing between username = '' key = '' So, it should be: `username` = '" . $this->db->escape($username) . "' AND `key` = '" . $this->db->escape($key) . "' in "catalog/model/account/api.php" – ar27111994 Nov 13 '17 at 08:07