Skip to content

API Documentation

Kristoffer Pöpperling edited this page Jun 26, 2018 · 3 revisions

Table of Contents

Basics

To get access to the public interface you have to be registered as a developer and must have an Access Token. To know how to get a token take a look at the OAuth2 documentation.

The basic URL for all requests is https://api.fryd.zone

Request

Every request must have an access token. The token can be part of the request body or the request header with the name token. The same is true for ids (like location_id, trophylist_id or trophy_id).
Request Body example:

 {
  "token": ''Access Token'',
  "user_id" |& "location_id" |& "trophylist_id" |& "trophy_id": ''The unique Id of an entity''
 }

Response

The responses are all based on the same pattern:

 {
  "response": { ''requested data'' },
  "uid": ''A unique id, that can be used to find exceptions'',
  "message" (OPTIONAL): { 
    "type": "INFO" | "WARN" | "ERROR",
    "text": ''message text''
  }
 }

Userinformation

The following requests request user information. You can get the user information of the user who's access token you are using. The user can configure what information you can get in the privacy settings. The only fields that you always get are : username, avatarpic_id(if an avatar picture exists), xp and level.

Request Response
 POST https://api.fryd.zone/api/user HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",
               }
OR
 POST https://api.fryd.zone/api/user HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 429
 
 MINIMAL:
 
 {
   "response":    {
      "id": "57a33c288f30f31a7cdc20g7",
      "username": "CoolDude1",
      "xp": 20,
      "avatarpic_id": "57a33c288f30f31a7cdc20c6",
      "level": 2
   },
   "uid": "CA22F9F5843EE055879C3EE0"
 }
 OR MAXIMAL:
 
 {
   "response":    {
      "id": "57a33c288f30f31a7cdc20g7",
      "username": "CoolDude1",
      "firstname": "Heinz",
      "lastname": "Hummer",
      "email": "heinz@hummer.eu",
      "birthday": "1977-12-11T00:00:00Z",
      "address":       {
         "street": "Ladenstraße",
         "nr": "17",
         "postal_code": 666666,
         "city": "Somewhere Town"
      },
      "xp": 20,
      "avatarpic_id": "57a33c288f30f31a7cdc20c6",
      "level": 2,
      "progress":       [
{
]
   },
   "uid": "579C1D9EEC78441A1A1FCD07"
 }

Find all achieved trophies of the user (but only for the "asking" fryd spot):

Request Response
 POST https://api.fryd.zone/api/user/trophies HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",
               }
OR
 POST https://api.fryd.zone/api/user/trophies HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 624
 
 {
   "response": {"progress":    [
{
]},
   "uid": "7B1B8FC8806707D4CADCB493"
 }

fryd Spot Information

The following requests get fryd Spot information.

Request Response
 POST https://api.fryd.zone/api/location/ HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",   
                "location_id": "57d014e2b9ad432b045c9aae"
               }
OR
 GET https://api.fryd.zone/api/location/57d014e2b9ad432b045c9aae HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 495
 
 {
   "response":    {
      "id": "57d014e2b9ad432b045c9aae",
      "name": "SampleApp",
      "description": "This is a simple sample",
      "type": "ONLINE",
      "homepage": "https://www.sample.zone",
      "age_range": "0-99",
      "opening_time": {"addition": "Immer, solange es Internet gibt"},
      "trophylist_id": "57d019d6b9ad433518b1f665",
      "created": "2016-09-09T00:00:00Z",
      "owner_id": "57a31fb78f30f31ce41c037f",
      "status": "ACTIVE"
   },
   "uid": "8231DF6E2908459C6CDCE477"
 }

Trophylist Information

The following request gets all trophylists of a fryd Spot.

Request Response
 POST https://api.fryd.zone/api/trophylists/ HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",   
                "location_id": "57d014e2b9ad432b045c9aae"
               }
OR
 GET https://api.fryd.zone/api/trophylists/57d014e2b9ad432b045c9aae HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 573
 
 {
   "response" : {
     "trophylists" : [{
]
   },
   "uid" : "E205DE99399129F0E565A1EF"
 }

Trophy Information

The following request gets all trophies in a trophylist.

Request Response
 POST https://api.fryd.zone/api/trophies HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",   
                "trophylist_id": "57d019d6b9ad433518b1f666"
               }
OR
 GET https://api.fryd.zone/api/trophies/57d019d6b9ad433518b1f666 HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 423
 
 {
   "response": {
       "trophys":    [
{
]},
   "uid": "CEDF46790C5336A9DB16B41E"
 }

The following request gets all information from one trophy.

Request Response
 POST https://api.fryd.zone/api/trophy HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: {
                "token": "57d014e2b9ad432b045c9aaf",   
                "trophy_id": "57d13ba1b9ad43348cd2399e"
               }
OR
 GET https://api.fryd.zone/api/trophy/57d13ba1b9ad43348cd2399e HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 token: "57d014e2b9ad432b045c9aaf"
 
 HTTP/1.1 200 OK
 content-type: application/json; charset=utf-8
 Content-Length: 471
 
 {
   "response":    {
      "id": "57d13ba1b9ad43348cd2399e",
      "name": "Pausenkönig",
      "description": "Besiege in einer Pause Hans bei Street Fighter 2 Turbo",
      "type": "INTERNAL",
      "author_id": "57a31fb78f30f31ce41c037f",
      "list_id": "57d019d6b9ad433518b1f666",
      "points": 25,
      "money": 10,
      "hidden": false,
      "order": 3,
      "difficulty": "EASY",
      "list_name": "SampleApp Bewerber Event",
      "author_name": "Blizzard"
   },
   "uid": "3D62A14F4F735E4F763FC13B"
 }

Trophy Tracking

The following request tracks a trophy for a user. You need both token be make such a request.

Request Response
 POST https://api.fryd.zone/api/trophycheck HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 message-body: { 
                "user_token": "57d014e2b9ad432b045c9aaf",
                "app_token": "56t416u7d8we284h609f1gfj",
                "location_id": "585157821d33a9228cb281e2",
                "secret": "Key to track a trophy"
               }
OR
 POST https://api.fryd.zone/api/trophycheck HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 user_token: "57d014e2b9ad432b045c9aaf"
 app_token: "56t416u7d8we284h609f1gfj"
 message-body: { 
                "location_id": "585157821d33a9228cb281e2",
                "secret": "Key to track a trophy"
               }
 
 HTTP/1.1 204 No Content
 Content-Length: 0

Clone this wiki locally