So I have been working on creating Wix website that use MLS and I have not found the best solution yet. I think with Corvid, there may be a nice way to finally make this work.
The plan is to pull all of the listing information from an API called SimplyRETS (you can see their sample data here - https://docs.simplyrets.com/api/index.html#!/default/get_properties ). I plan on pulling from the “properties” section of the API.
Anyway, I’m wondering if I could get any guidance as to how best implement this (probably in a .jsx web module) on Corvid, using the fetch features. The issue I’m running into is the fact that the documentation is strictly explaining how to do the API call using cURL, and there is also authentication here. Finally, I’m getting an error when trying to use base64. Here is what I have so far, but any guidance would be helpful
let url = ‘https://api.simplyrets.com/properties?limit=500&lastId=0’;
let username = ‘simplyrets’;
let password = ‘simplyrets’;
let headers = {
‘Authorization’: 'Basic ’ + base64.encode(username + “:” + password)
};
let options = {
method:‘POST’,
headers: headers
}
fetch(url, options)
.then((httpResponse) => {
// Add code to check the response
})
}