Hi! On my website, I have a dynamic page for each clinic we’re working with. I’d like the dynamic page to show the Yelp and Google ratings available for those clinics. Both Yelp and Google make it possible via APIs, but I can’t seem to be able to use those APIs in Corvid. I’ve tried to follow the explanation below, but I don’t get how to apply it to this need. https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
I’m actually not trying to retrieve the reviews, just the overall rating and the # of reviews (which is possible in both cases). For example - clinic A has a rating of 4.5 based on 140 reviews.
@shantanukumar847 Thanks! this helped me so much!!!
FYI - for future reference, if this helps anyone - since I’m using a dynamic placeID I made a small change :
//Fetch google review - calls on BE function that we created in GoogleAPI.jws
import {google} from 'backend/GoogleAPI.jsw';
$w.onReady(function () {
google($w('#doctors1').getCurrentItem().googlePlaceId)
.then( (response) => {
console.log(response); //entire response
let googleRatings = $w('#ratingsDisplay2');
googleRatings.rating = response.result.rating;
console.log(googleRatings.rating);
googleRatings.numRatings = response.result.user_ratings_total;
console.log(googleRatings.numRatings);
});
});
but I’m getting a Parsing Error: Unexpected Token key. I tried to research if I’m using the “Authorization: Bearer” incorrectly, but this seems to be the right way. Any idea why I’m getting this Parsing Error?