Connecting/Previewing Databases from Two Seperate Websites

Good day!

I have the need to connect or display information on a completely seperate Wix Website from a different Wix Website.
(In other words, there’s a Wix Site that has a database collection with information, and I need to display the information from that collection in a different Wix Site.=

How could I go about doing that? Thank you very much in advance!

Hello Jason!

This can be done by exposing your sites API’s using the https-functionality of Wix. Here is a detailed tutorial guiding you on how to do that. Here is the official documentation for it.

Basically, you run a GET request to your site, that site sees that GET request, processes it accordingly, and sends back data (JSON).

Goodluck!
Majd

Thank you very much! I don’t know code but I have been trying this out for over an hour and experimenting to try to get this to work, but I haven’t had any luck. So I’ve got a few questions so I try to get this to work.

  1. From the documentation, which set of code do I have to initially use on the website that I want to send out data.
  2. Do I use the get(), post(), or put() on the receiver website?
  3. I know I need to insert the link in one or both of the code blocks and I have the link format based on the instructions but I’m not quite sure where exactly I have to input it in the block of code.
  4. When I use the http function and it gets the data, will it put the data in a collection or otherwise?
  5. Last question, is the other website (reciever) of the data also allowed to edit the data of the sender website?

Apologies for the large amount of questions, but I really want to work to get this going. I appreciate any help!

Best regards,
Jason L.

See the example MyApi and MyApiClient to expose and access external APIs. It’s pretty much what you want.