CINXE.COM

Fredagskakan!

<!DOCTYPE html> <html> <head> <title>Fredagskakan!</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../w3.css"> <meta property="og:type" content="website" /> <meta property="og:title" content="Fredagskakan!" /> <meta property="og:url" content="http://fredagskakan.se/" /> <meta property="og:site_name" content="Fredagskakan!" /> <meta property="og:image" content="https://x.29a.se/fk/avatar.jpg" /> <meta property="og:image:width" content="512" /> <meta property="og:image:height" content="512" /> <meta property="og:locale" content="sv_SE" /> <link rel="icon" href="./avatar.jpg" /> <meta name="msapplication-TileImage" content="./avatar.jpg" /> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-PWTFXYRVL2"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-PWTFXYRVL2'); </script> </head> <body> <div class="w3-container w3-pale-yellow"> <br /> <h1>Fredagskakan!</h1> <br /> <center> <p><a href="../">Veckans kaka</a>&nbsp &nbsp <a href="../kakschema">Kakschema</a>&nbsp &nbsp <a href="../api">API</a>&nbsp &nbsp </p> </center> </div> <br /> <div class="w3-bar"> <!-- ###################################################### --!> Fredagskakan erbjuder ett API för att kollegor bland annat ska kunna hålla koll på veckans kaka. <s>Det finns även möjlighet att sortera och titta på historiska betyg. Det nya API:et introducerar även möjlighet att rösta*</s> <br /> <br /> <em>*) Röstning kan enbart göras med hjälp av API-nyckel som måste utfärdas av Fredagskakan.se</em> <br /> <br /> API URL: <strong><em>https://api.fredagskakan.se</em></strong> <br /> <h2><a id="Get_kaka_for_current_week_78"></a>Get kaka for current week</h2> <h4><a id="GET_thisweek_81"></a>GET /thisweek</h4> <br /> <strong>Output</strong>: <pre><code>{ "Kaka": "Fastlagsbulle", "URL": "https://s3-eu-west-1.amazonaws.com/fredagskakan/semla.jpeg" } </code></pre> <table class="table table-striped table-bordered"> <thead> <tr> <th>HTTP response code</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>OK</td> </tr> <tr> <td>500</td> <td>Something went wrong</td> </tr> </tbody> </table> <h2><a id="Get_a_list_of_kakor_97"></a>Get a list of kakor</h2> <h4><a id="GET_getkakayearweek_100"></a>GET /getkaka/:year/:week</h4> <strong>Parameters:</strong> year <em>(optional)</em>: four-digit representation of a year, i.e. 2019 week <em>(optional)</em>: two-digit representation of a week number, i.e. 10 <br /> <strong>Output:</strong> If both <em>year</em> and <em>week</em> parameters are present, an object as described below is returned by itself. If <em>year</em> or no parameters are present, an array of objects as described below is returned. Object: <pre><code>{ "Kaka": "Fastlagsbulle", "Scores": [ { "Location": "S4", "Score": 3.076923076923077 }, { "Location": "T6", "Score": 4 }, { "Location": "all", "Score": "3.53846153846" } ] } </code></pre> <table class="table table-striped table-bordered"> <thead> <tr> <th>HTTP response code</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>OK</td> </tr> <tr> <td>404</td> <td>No kakor found</td> </tr> <tr> <td>500</td> <td>Something went wrong</td> </tr> </tbody> </table> &nbsp; <h2><a id="Cast_a_vote_3"></a>Cast a vote</h2> <h4><a id="POST_vote_6"></a>POST /vote</h4> <strong>Input:</strong> <pre><code>{ "timestamp": "location": "score": "api_key": } </code></pre> <strong>Output:</strong> <pre><code>{ "Status": "OK" } </code></pre> <table class="table table-striped table-bordered"> <thead> <tr> <th>HTTP response code</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>Vote was registered</td> </tr> <tr> <td>400</td> <td>Invalid data in POST</td> </tr> <tr> <td>403</td> <td>Vote was cast outside of voting window or API key is incorrect</td> </tr> <tr> <td>500</td> <td>Something went wrong</td> </tr> </tbody> </table> <h2><a id="Get_current_average_score_for_ongoing_vote_33"></a>Get current average score for ongoing vote</h2> <h4><a id="GET_currentscorelocation_36"></a>GET /currentscore/:location</h4> <strong>Parameters:</strong> location <em>(optional)</em>: A location, i.e. “T6”. If ommited, the current average score for all locations will be returned. <br /> <strong>Output:</strong> <pre><code>{ "Location": "all" "Score": "3.1415" } </code></pre> <table class="table table-striped table-bordered"> <thead> <tr> <th>HTTP response code</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>OK</td> </tr> <tr> <td>500</td> <td>Something went wrong</td> </tr> </tbody> </table> <h2><a id="List_all_locations_56"></a>List all locations</h2> <h4><a id="GET_listlocations_59"></a>GET /listlocations</h4> <br /> <strong>Output:</strong> <pre><code>{ "Locations": [ "T6", "S4" ] } </code></pre> <table class="table table-striped table-bordered"> <thead> <tr> <th>HTTP response code</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td>200</td> <td>OK</td> </tr> <tr> <td>500</td> <td>Something went wrong</td> </tr> </tbody> </table> <!-- ######################################################### --!> </div> <div class="footer"> <center>Copyright fredagskakan.se 2025</center> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10