Sage
BBuildShip
•Created by Sage on 6/17/2024 in #💬・general
Sage - Hey guys, love the community, love the a...
This seems like it will work. There is a field I don’t know called Template Configuration … any ideas ?
4 replies
BBuildShip
•Created by Sage on 6/17/2024 in #💬・general
Sage - Hey guys, love the community, love the a...
Thank you
4 replies
BBuildShip
•Created by Sage on 6/5/2024 in #💬・general
Sage - Does anyone know, in the “send emails wi...
It’s more complex. May I DM you?
7 replies
BBuildShip
•Created by Sage on 6/5/2024 in #💬・general
Sage - Does anyone know, in the “send emails wi...
@Harini would you perhaps know the answer to this one? I don’t normally tag people in my questions but this one hasn’t had any traction in a few days
7 replies
BBuildShip
•Created by Sage on 6/5/2024 in #💬・general
Sage - Does anyone know, in the “send emails wi...
🦗
7 replies
BBuildShip
•Created by Sage on 6/4/2024 in #💬・general
Sage - Am I calling the API Key correctly ?
Thank you !
5 replies
BBuildShip
•Created by Sage on 6/4/2024 in #💬・general
Sage - Am I calling the API Key correctly ?
import axios from 'axios';
export default async function getPlaceDetails({ businessUrl, apiKey }) {
const findPlaceUrl =
https://maps.googleapis.com/maps/api/place/findplacefromurl/json?input=${encodeURIComponent(businessUrl)}&inputtype=textquery&fields=place_id&key=${apiKey}
;
let response = await axios.get(findPlaceUrl);
if (response.data.candidates && response.data.candidates.length > 0) {
const placeId = response.data.candidates[0].place_id;
const detailsUrl = https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&fields=name,formatted_address,geometry&key=${apiKey}
;
response = await axios.get(detailsUrl);
if (response.data.result) {
return {
businessName: response.data.result.name,
businessAddress: response.data.result.formatted_address,
businessCoordinates: response.data.result.geometry.location,
}
} else {
throw new Error('No place details found');
}
} else {
throw new Error('No place id found');
}
}5 replies