Post by sandstorm001 » Sat Sep 28, 2024 2:21 am

I tried the api about a year ago with OC3 maintenance and got nothing to work with it. Today I decided to make a fresh install of OC4 and try the api again with python but even using the exact example from api documentation does not give anything to work with. Response I get with API example is:

Code: Select all

import requests

s = requests.Session()

username = 'Default'
key='L3MYyzlYMRL8gBcpCm6CdrVarFUXtPORZkJKP7vgaY8M8EIZWOr3EJxq'
# Actually, key is 256 character-long

s.post(
    'https://myopencart.example.com/index.php?route=api/login',
    data={'username':username, 'key':key}
).text
Response I output from post gives only 404 connection failed and a chunk of html code.

Anyone know what is going on with this API and is there any actual example code that works?

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

Post by JNeuhoff » Sat Sep 28, 2024 2:51 am

What exactly are you trying with the API? The OpenCart API is very limited and in general not designed for usage by other apps.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by sandstorm001 » Sat Sep 28, 2024 3:04 am

I'd like to use opencart in the background and have just basic operations on my own website. I would need to have ability to register, login, add products to cart (product id is fine) and use payment with it. Products would be files so also customer would need access to the file they've purchased.

Python code is just for testing from my laptop since I got tired trying to get access with the api from the webpage code. I have added my ip's to the list so it should be ok.

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by sandstorm001 » Sat Sep 28, 2024 12:46 pm

Yeah, I read about it somewhere on the forums, but I can't afford any extensions right now. I need a free solution.

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

Post by JNeuhoff » Sat Sep 28, 2024 6:50 pm

Well, there is no such thing as a free lunch.

The OpenCart API is quite limited, it's not designed to be a REST API.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by sandstorm001 » Sat Sep 28, 2024 8:38 pm

Well, Opencart is free as far as I know.

And the question remains, does the api work, even in it's limited capacity? I don't mind the limits if it is usable.

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

Post by chongshengdz » Mon Sep 30, 2024 2:59 am

not yet, daniel is working on it these days.
it should be working soon.

https://www.ectransistors.com/
https://www.transistormosfet.com/


Active Member

Posts

Joined
Sat Apr 12, 2014 10:18 pm


Post by paulfeakins » Mon Sep 30, 2024 7:26 pm

sandstorm001 wrote:
Sat Sep 28, 2024 3:04 am
I'd like to use opencart in the background and have just basic operations on my own website. I would need to have ability to register, login, add products to cart (product id is fine) and use payment with it. Products would be files so also customer would need access to the file they've purchased.
You're not really explaining very well what you want to do?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by sandstorm001 » Sat Oct 12, 2024 2:57 am

paulfeakins wrote:
Mon Sep 30, 2024 7:26 pm
sandstorm001 wrote:
Sat Sep 28, 2024 3:04 am
I'd like to use opencart in the background and have just basic operations on my own website. I would need to have ability to register, login, add products to cart (product id is fine) and use payment with it. Products would be files so also customer would need access to the file they've purchased.
You're not really explaining very well what you want to do?
Well, I want to use my own website as the front and use opencart in the back. I would like to create my own GUI for a basic shop in my own website which would use the API to do the opencart magic in the background, i.e. handle the payment gateways, customer registration, login, cart and such. I need the data to flow back and forth so I can update my webpage data based on opencart API data it can provide.

But I'm guessing I'll just make my website and put the opencart to a subdomain where I point the customers to do their purchases with a simple link, it's not really ideal solution. Not too familiar with web code even with AI's help, I'm more of an embedded software guy :)

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

Post by paulfeakins » Mon Oct 14, 2024 6:03 pm

sandstorm001 wrote:
Sat Oct 12, 2024 2:57 am
Well, I want to use my own website as the front and use opencart in the back. I would like to create my own GUI for a basic shop in my own website which would use the API to do the opencart magic in the background,
Why? Why not just make a new theme for OpenCart?

sandstorm001 wrote:
Sat Oct 12, 2024 2:57 am
i.e. handle the payment gateways, customer registration, login, cart and such. I need the data to flow back and forth so I can update my webpage data based on opencart API data it can provide.
A lot of those things are heavily integrated to the front-end necessarily, so I'm not really sure what benefit you'll get from doing it that way.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Mon Oct 14, 2024 7:00 pm

sandstorm001 wrote:
Sat Oct 12, 2024 2:57 am
But I'm guessing I'll just make my website and put the opencart to a subdomain where I point the customers to do their purchases with a simple link, it's not really ideal solution. Not too familiar with web code even with AI's help, I'm more of an embedded software guy :)
I think it will probably be easier for you to just use OpenCart only for your website. OpenCart already has all the needed ecommerce features. And for your other frontend content pages you could use a content management system, useful for blogs or general articles. Along with a suitable standard-compliant OpenCart web theme you'd quickly have your fully integrated website. We recommend OpenCart 3.0.4.0 for live sites.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by sandstorm001 » Fri Oct 18, 2024 4:48 am

Thanks, I've used themes to this day but need something different.

I hope that opencart could evolve into a more "modular" solution so user can use the shop in the background. User could use actions like Add to Cart, Cart, Login and Register and such in a webpage code. Dunno if this is possible but it would give a lot of freedom on how webshops would look. You could integrate opencart into an article, blog or webpage etc. or maybe a 3D game on the browser.

I would certainly recommend this feature since I could just mold any kind of a web page, even 3D and add a ecommerce functionality into it. I think this is the future for ecommerce and I wish Opencart would be part of it.

Opencart has remained unchanged for quite a long time. It works but it's starting to look old school.

New member

Posts

Joined
Mon Feb 01, 2016 3:39 pm

Post by JNeuhoff » Fri Oct 18, 2024 5:07 pm

sandstorm001 wrote:
Fri Oct 18, 2024 4:48 am
Opencart has remained unchanged for quite a long time. It works but it's starting to look old school.
Actually, 3D games are starting to be quite boring and old school. There are people out there in the world who are not slaves to smartphone devices :)

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Fri Oct 18, 2024 7:19 pm

sandstorm001 wrote:
Fri Oct 18, 2024 4:48 am
Thanks, I've used themes to this day but need something different.
Again, why?

sandstorm001 wrote:
Fri Oct 18, 2024 4:48 am
Opencart has remained unchanged for quite a long time. It works but it's starting to look old school.
That's why there are hundreds of themes and if you don't like those you can design and build your own.

Anything you want to do, you can do that way.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 3 guests