Integrating Wodify WODs with SquareSpace/Box Ally

Follow

Wodify_Bar_All.png

SquareSpace/Box Ally integrates with Wodify! Please copy & paste the code below into your site. Then, you have to update the following variables in order for the code to pull the correct information from your Wodify environment.

 

In this article, we will cover:

 

Site Code

Please add the below to each page you'd like the WOD displayed:

 

<div id="wodcontainer"></div>

<script type="text/javascript">
var getWodDetails = ({ elementId, apiKey, location, program }) => {
var today = new Date();
var date = `${today.getFullYear()}-${(today.getMonth() + 1)}-${today.getDate()}`;
var fetchUrl = `https://app.wodify.com/API/WODs_v1.aspx?apiKey=${apiKey}&date=${date}&location=${encodeURIComponent(location)}&program=${encodeURIComponent(program)}&type=json`;
fetch(fetchUrl)
.then(response => response.json())
.then(data => {
if (data && data.RecordList && data.RecordList.APIWod.FormattedWOD) {
var container = document.getElementById(elementId);
container.innerHTML = data.RecordList.APIWod.FormattedWOD;
}
});
};
getWodDetails({
elementId: "wodcontainer",
apiKey: "APIKEY GOES HERE",
location: "YOUR LOCATION GOES HERE",
program: "YOUR PROGRAM GOES HERE"
});
</script>

 

Updating Variables

You will need to update the following:

  • "apiKey": Enter the API key for the tenant here
  • "location": Enter the name of the location you wish to pull WODs from
  • "program": Enter the name of the program you wish to pull WODs from
  • "numDays" : Enter the number of days for which you'd like WODs to be displayed, starting today and moving backwards (to show just the current day, enter 1, to show the past week, enter 7)

 

Note: HTTPS is required to use the WODs API.

 

If you need any additional assistance with SquareSpace/Box WODs, feel free to reach out to us at support@wodify.com.

Comments

Check the current status of our products

View status