This article explains how to connect this application to the website in which VikRestaurants is installed.

In order to prevent unauthorized accesses to the sensitive data stored on your VikRestaurants, the communication is protected behind a HTTP BASIC AUTH login. So, the first thing to do is creating an account that the application will use for the authentication with the API end-point.

  • open the Configuration page of VikRestaurants;
  • access the Applications section;
  • click the See Users List button;
  • hit the New button from the toolbar on top.

Setup - API Users

From the creation page of an API user you must configure at least 3 parameters:

  • the username for the authentication;
  • the password for the authentication;
  • enable the Active option to allow the login.

We strongly recommend to generate the password by using the apposite button, in order to prevent insecure logins.

Afterwards you can optionally enter an application name, choose to restrict the authentications to a few IP addresses only and to define all the plugins/events that the application can dispatch. The application uses only 3 plugins among all the existing ones:

  • Connection Ping, for testing the authentication;
  • Get Orders List, to download the existing orders and reservations;
  • Get Order Details, to download the details of a specific order/reservation.

Hit the Save button when you have finished with the configuration of the account.

Setup - New API User

Before to move to the application, let's test whether the account we created is working fine. You should go back to the Applications configuration page and click the See Installed Plugins button, below the one used to access the users list.

From this page you should click the "sticky note" icon next to the description of the Connection Ping plugin.

Setup - API Plugins

Here's explained how this plugin works.

You need to pick the application you have just created through the dropdown placed under the Generate Ping URL section. Afterwards, click the link below the dropdown to check whether the application is up and running.

Should you get a response similar to the following one, then it's all ok.

{"status":1,"version":"1.8.4","platform":"joomla"}

Setup - API Connection Ping

Now let's start the application (VRE Printer) and access the Preferences panel. You can find the Preferences item under VRE Printer menu on macOS and under File menu on Windows.

The authentication is made through the Host section of the preferences, which should be pre-selected by default. Here you have to enter all the following details:

  • Base URL - the website in which VikRestaurants is installed;
  • Username - the username of the application previously created;
  • Password - the password of the application previously created.

If you don't exactly know what to enter within the Base URL parameter, just specify the home page of your Joomla website.

Every time one of these parameters change, the system automatically attempts to establish a connection. If you followed all the steps in the right way, you should see a successful message saying that the application is now connected with VikRestaurants.

Setup - VRE Print - Host

In order to complete the first setup of the application, you should access the Orders section and click the Restore button, under the Synchronization panel. This way, the system should immediately download all the orders and reservations stored within your VikRestaurants.

It is now recommended to take a look at the preferences documentation to understand how all the other parameters works, mainly the ones related to the Print section.

Troubleshooting

Are you getting a "empty username or password" error while trying to connect the application to your VikRestaurants?

If you properly specified a username and password, it is possible that your server does not support HTTP BASIC authentication scheme.

Some hosting providers retain that HTTP BASIC AUTH is deprecated and no more supported. But, as can be seen from the link below, there's no mention about any deprecation:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#basic_authentication_scheme

It may be discouraged the usage of this type of authentication without HTTPS/TLS protocol, but, as long a website owns a SSL certificate, it should be possible to use this authentication without worries.

Alternatively, in case the server already supports this kind of authentication, the web server might not be properly configured to inject the user credentials within the Authorization header. It is possible to find a few suggestions and examples under the PHP documentation:
https://www.php.net/manual/en/features.http-auth.php#114877

So, how can I get this stuff working? You should contact your hosting provider and ask them whether the HTTP BASIC authentication scheme can be enabled/fixed on your website.

Last Update: 2021-07-06 12:43
Helpful?
67% of people found this helpful.
See Also: