JSON Example, Sample, and Response

Below are the CSS Classes available to style your WOD:



Wodify REST API Endpoints


GET https://app.wodify.com/API/WODs_v1.aspx?apikey=&location=&program=&date=&type=&encoding=

Wodify's REST API an use response types xml or json.

The following article contains:

1. JSON Example
2. JSON Sample
3. JSON Response

1. JSON Example:

<!doctype HTML>
<html>
<head>
</head>
<body>
<?php
 /*
         * Quick function that makes a call to the Api/WODs_v1 endpoint, getting WODS for a certain date.
         * Parameters:
         * $apikey = your api key
         * $date = the date the wod took place, in YYYY/MM/DD format
         * $location = the name of the location where the wod took place
         * $program = the name of the program that the wod was a part of
         * $isJSON = a boolean value indicating the response format
         * $encoding = "utf-8", "utf-16", or "ascii"
         */
        function GetWODs($apikey, $date, $location, $program, $isJSON, $encoding){

            $data = array(
                "apikey" => $apikey,
                "date" => $date,
                "location" => $location,
                "program" => $program,
                "type" => $isJSON ? "json" : "xml",
                "encoding" => $encoding
            );

            $ch = curl_init();

            $url = sprintf("%s?%s", "http://app.wodify.com/API/WODs_v1.aspx", http_build_query($data));

            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HEADER, false);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

            $result = curl_exec($ch);
            return $result;
        }

$json = true; //JSON
        $response = GetWODs("np3g23grc9j81jlamjqmu1yo0", "2012-11-20", "Main", "Crossfit", $json);
        $jsonResponse = json_decode($response, true);
        $jsonWod = $jsonResponse["RecordList"]["APIWod"]["WodHeader"];
?>
</body>
</html>

2. JSON Sample:

{
   "RecordList":{
      "APIWod":{
         "WodHeader":{
            "Id":"17286",
            "Date":"2012-11-20",
            "ShouldPublish":"False",
            "Name":"Lactic tuesday",
            "OwnershipLevelId":"3",
            "UserId":"0",
            "ProgramId":"5",
            "ResultsPosted":"False",
            "HasBeenSaved":"False",
            "CreatedBy":"17597",
            "CreatedOn":"2013-04-03T14:50:36",
            "UpdatedBy":"17597",
            "UpdatedOn":"2013-04-03T14:50:36",
            "IsActive":"True"
         },
         "Components":{
            "Component":[
               {
                  "Id":"14223",
                  "ComponentTypeId":"2",
                  "OwnershipLevelId":"3",
                  "PerformanceResultTypeId":"4",
                  "UserId":"0",
                  "Description":"4 rds\n60 sec amrap max cal row\n60 sec amrap Double unders\n60 sec Amrap Kb swings (53/35)\nRest/walk for 3 mins",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"True",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "EachRoundTypeId":"0",
                  "CreatedBy":"17597",
                  "CreatedOn":"2013-04-03T14:50:38",
                  "UpdatedBy":"17597",
                  "UpdatedOn":"2013-04-03T14:50:38",
                  "IsActive":"True"
               },
               {
                  "Id":"14111",
                  "ComponentTypeId":"4",
                  "OwnershipLevelId":"3",
                  "PerformanceResultTypeId":"1",
                  "UserId":"0",
                  "Name":"Pullups (max reps)",
                  "Description":"B. Back rack barbell Bulgarian split squats 3 x 6 per leg \nrest 1 min btw legs\nC. Weighted plank hold accumulate 4 mins\nD. Shuttle sprints x 3 rest 2 mins\n (25m up and back, 50m up and back =1)",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"True",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "EachRoundTypeId":"0",
                  "CreatedBy":"17597",
                  "CreatedOn":"2013-04-03T14:45:07",
                  "UpdatedBy":"17597",
                  "UpdatedOn":"2013-04-03T14:45:07",
                  "IsActive":"True"
               }
            ]
         },
         "CreatedByUser":{
            "Id":"0",
            "Is_Active":"True"
         },
         "UpdatedByUser":{
            "Id":"0",
            "Is_Active":"True"
         },
         "CreatedDate":"2013-04-03",
         "UpdatedDate":"04/03/2013 14:50:36",
         "Location":{
            "Id":"5",
            "Name":"Main",
            "StateId":"0",
            "CountryId":"0",
            "CreatedBy":"17597",
            "CreatedOn":"2000-01-01",
            "UpdatedBy":"0",
            "IsActive":"True"
         },
         "Program":{
            "Id":"5",
            "Name":"Crossfit",
            "Description":"Crossfit",
            "CreatedBy":"17597",
            "CreatedOn":"2000-01-01",
            "UpdatedBy":"0",
            "Is_Active":"True"
         },
         "Announcements":{
            "Announcement":{
               "Id":"17",
               "Message":"Test Announcement",
               "FromDate":"2012-04-02",
               "ToDate":"2012-12-21",
               "IsExternal":"True",
               "CreatedBy":"19330",
               "CreatedOn":"2013-04-05T12:11:50",
               "UpdatedBy":"19330",
               "UpdatedOn":"2013-04-05T12:11:50",
               "IsActive":"True"
            }
         }
      }
   }
}

3. JSON Response:

{
   "RecordList":{
      "APIWod":{
         "WodHeader":{
            "Id":"24977",
            "Date":"2013-04-13",
            "ShouldPublish":"False",
            "PublishDateTime":null,
            "Name":"WOD",
            "Comments":null,
            "OwnershipLevelId":"3",
            "UserId":"19330",
            "ProgramId":"5",
            "BlogPostId":null,
            "IsPostUpdateRequired":"True",
            "IsPostedToFacebook":"False",
            "HasBeenSaved":"True",
            "CreatedBy":"19330",
            "CreatedOn":"2013-04-12T15:46:58",
            "UpdatedBy":"19330",
            "UpdatedOn":"2013-04-12T16:23:16",
            "IsActive":"True"
         },
         "CreatedDate":"2013-04-12",
         "UpdatedDate":"04/12/2013 16:23:16",
         "Location":{
            "Id":"5",
            "Name":"Main",
            "StreetAddress1":null,
            "StreetAddress2":null,
            "City":null,
            "StateId":"0",
            "ZipCode":null,
            "CountryId":"0",
            "Province":null,
            "CreatedBy":"17597",
            "CreatedOn":"2000-01-01",
            "UpdatedBy":"0",
            "UpdatedOn":null,
            "IsActive":"True"
         },
         "Program":{
            "Id":"5",
            "Name":"Crossfit",
            "Description":"Crossfit",
            "Color":null,
            "PublishExternally":"True",
            "CreatedBy":"17597",
            "CreatedOn":"2000-01-01",
            "UpdatedBy":"0",
            "UpdatedOn":null,
            "Is_Active":"True"
         },
         "Announcements":null,
         "Components":{
            "Component":[
               {
                  "Id":"7087",
                  "ComponentTypeName":"Metcon",
                  "OwnershipLevelName":"Global",
                  "UserName":null,
                  "Name":"Del",
                  "Description":"For Time: \n25 Burpees \n400m run with a 20# medicine ball\n25 Weighted pull-ups with 20# dumbbell 400m run with a 20# medicine ball \n25 Handstand push-ups \n400m run with a 20# medicine ball \n25 Chest-to-bar pull-ups \n400m run with a 20# medicine ball \n25 Burpees",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"False",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "Comments":null,
                  "Reps":null,
                  "PerformanceResultTypeName":"Time"
               },
               {
                  "Id":"7089",
                  "ComponentTypeName":"Metcong",
                  "OwnershipLevelName":"Global",
                  "UserName":null,
                  "Name":"Diane",
                  "Description":"21-15-9 \nDeadlifts, 225# / 155# \nHandstand Push-ups",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"False",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "Comments":null,
                  "Reps":null,
                  "PerformanceResultTypeName":"Time"
               },
               {
                  "Id":"7097",
                  "ComponentTypeName":"Metcon",
                  "OwnershipLevelName":"Global",
                  "UserName":null,
                  "Name":"Fran",
                  "Description":"21-15-9 \nThrusters, 95# / 65# \nPull-ups",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"False",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "Comments":null,
                  "Reps":null,
                  "PerformanceResultTypeName":"Time"
               },
               {
                  "Id":"7097",
                  "ComponentTypeName":"Metcon",
                  "OwnershipLevelName":"Global",
                  "UserName":null,
                  "Name":"Fran",
                  "Description":"21-15-9 \nThrusters, 95# / 65# \nPull-ups",
                  "IsBenchmark":"True",
                  "HasBeenSaved":"True",
                  "IsNewComponentEmailSent":"False",
                  "AllowRxPlus":"False",
                  "Rounds":"0",
                  "Comments":null,
                  "RepScheme":null,
                  "PerformanceResultTypeName":"Time"
               }
            ]
         }
      }
   }
}



4. JSON Errors

If the WOD you are trying to find does not exist, the response will contain an APIError field with the details. For example:

{
  "APIError": {
    "ResponseCode":"400",
    "ErrorMessage":"No workout found matching those criteria. Please change your search parameters and try again."
  }
}




Feedback and Knowledge Base