API to retrive list of locations

Hi I’m quite new to Wix and have tried to follow a few of the API tutorials for getting the weather/currency FX rates using an API, (so i can create buttons/objects/forms etc)

Can someone help and advise how I can embed a “Get” command into the code? The external endpoint i’m trying to reach is for example:
api locations com/all_locations
I would need to use basic authentication with a username and password.
I also need to add a couple of headers into the request

Thanks,

Jack

You will need to read about how to access 3rd party services in the article Corvid: How to Access 3rd-Party Services with the Fetch API .

Take a look at the Advanced examples , many of them access 3rd party services. A couple of good examples to start with are: Example: Using the Places API from Google Maps services and Example: Send email with the SendGrid REST interface .