Back to top

This is the offical stomt documentation.

Request/Response format 

This is the standard Response format. Read this first.

To keep the API endpoint flexible, maintainable and extendable, we defined a standard set of custom HTTP headers and a fix output format. In this section you’ll learn how requests are build and how responses will always look like.

Current state is RFC (Request for comments).

Launch for this API version is planned for the 20th of November ‘14.

Standard Request Headers

  • appid Contact Philipp for yours.

  • userlang ISO 639-1 Supported: de, en.

  • devicetype Users device format

    • Smartphones: web_mobile, android_mobile, ios_mobile
    • Tablets: web_tablet, android_tablet, ios_tablet
    • Desktop: web_desktop

Some attributes are flagged with (web) or (native) which means that they are only sent with on web/native calls. Methods marked with [LOGIN REQUIRED] need the following HTTP headers. If you’re a thirdparty you won’t need to auth as a user but have to add anonym: true and a generated userid.

  • accesstoken You’ll receive one after login

  • userid Users HASH-ID. See Auth section

These headers should always be sent if possible. In the following documentation we’ll only mention additional headers on top of these:

    appid:        (string)  // Your APP-ID (contact Philipp)
    accesstoken:  (string)  // If the user is logged in
    userid:       (string)  // If the user is logged in
    userlang:     (string)  // required | ISO 639-1 | e.g. 'en'
    devicetype:   (string)  // required | see above | e.g. 'ios_mobile'

Standard Response Format

  • Will always return HTTP status 200
  • Will always return content-type application/json

Take a look into the comments for further information.

    {
       // Always | Some meta information
       'meta' : {
          'amountItems':         (integer),  // Always | Amount of items in data-attribute
          'amountNotifications': (integer),  // Optional | Only if notifications exist
          'serverTime':          (integer)   // Always | UNIX Timestamp with server time
       },

       // Always | Contains the result
       'data' : [],

       // Optional | Only if unseen notifications are available
       'notifications': [],      // Notification - always Array - see below

       // Optional | Only if error occurs
       'error' : {
          'status' :  (integer),  // the 'real' HTTP Status code
          'msg' :     (string)    // Human readable error message
       }
    }

notification 

You don’t get notifications through a separate GET request. You get them delivered within each normal request.

You can find them under the notifications-attribute in the standard response format (see above).

This is how they look like:

  [
    {
        'id':       (integer),
        'text':     (string),    // Just display the text linking to the goal

        'goal': {
          'uri':    (string)(web), // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
          'type':   (string),    // Type: may be a target or a stomt
          'id':     (string)     // Hashed goal id
        },

        'ago' :     (string),    // "x minutes ago" - currently English only
        'seen':     (boolean),   // false = unseen; true = seen
        'clicked':  (boolean)    // false = unclicked; true = clicked
    }
  ]

Set notifications as seen/clicked 

If notifications are seen by the user (The user clicked on the notifications symbol) set the seen-attribute to true.

If the user clicks/taps on a notification set the clicked-attribute to true.

Set the notification to clicked or seen
/notifications/

[LOGIN REQUIRED]

  • Request
  • Headers
    Content-Type: application/json
    Body
    [
    {
        'id' :    (integer),
        'text' :  (string),
    
        'goal' : {
          'uri':  (string)(web), // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
          'type': (string),
          'id':   (string)
        },
    
        'ago' :   (string),       // "x minutes ago" - currently English only
        'seen':   (boolean)       // false = unseen; true = seen
        'clicked':(boolean)    // false = unclicked; true = clicked
    }
    ]
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
    {
        'id' :    (integer),
        'text' :  (string),
    
        'goal' : {
          'uri':  (string)(web), // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
          'type': (string),
          'id':   (string)
        },
    
        'ago' :   (string),       // "x minutes ago" - currently English only
        'seen':   (boolean)       // false = unseen; true = seen
        'clicked':(boolean)    // false = unclicked; true = clicked
    }
    ]
    

Misc 

Force to return raw result (content of “data”)

You can force the API to return the raw-result (content of “data”) by appending ?forceRaw=1 to the request.

Pagination

Use offset=(integer) and limit=(integer) parameters.

Feeds 

Feeds 

Get a specific feed
/feeds/{type}

[LOGIN REQUIRED]

  • Parameters
  • type
    string (required) Example: home

    Receive the feed in form of a stomt-collection

    Choices: home discover

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Body
    A collection of stomts (see "stomts" for further information)
    
Search anything on stomt
/search/{?q}{&c}{&ll}{&context}

To use the result you either need the “id” (native) or your need the “uri” (web). Most of the time we have to get data over thirdparty APIs. To persist all possible results would us require to cache the complete search-result and process them later via cronjob (to be implemented) or otherwise would slow down the search process for the end user. Therefore:

  1. Send a search request and DO NOT forget the context
  2. IF EXTERNAL (src != “s”) Send the target src & src_id to the server to prefetch external data 2.1 Receive and work with “id” or “uri” what you’ll receive depending on your app type (web/native)

If src == s you’ll receive id and uri(web) directly.

  • Parameters
  • q
    string (required) Example: iPhone

    Term to search for

    context
    string (required) Example: normal_search

    Search context

    Choices: normal_search stomt_creation

    c
    string (optional) Default: all Example: all

    Search in a specific category

    Choices: all person hashtags

    ll
    string (optional) Example: 27.175015,78.042155

    Latitude,Longitude (may improve search result)

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "users": {
          // Each result has the following data
          name:     (string),
          src_id:   (string),       // Context: stomt_creation
          src:      (string),       // Context: stomt_creation | important for content attribution
    
          // If src === 's' und Context: (empty)|normal_search
          uri:      (string)(web),
          id:       (string),       
      }
      "hashtags": {}
      "venues":   {}
    }
    

Authentification 

We have two different authentification flows.

Normal Credential flow
  1. Register a user via POST req. to /authentication/
  2. Get an access token via POST req. to /authentication/session
Facebook Connect flow
  1. Login and automatically register if not exist via POST to /authentication/session

User Management 

Registers a new user
/authentication/

Register a new user

  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          "username": (string),
          "email":    (string),
          "password": (string),
          "fullname": (string),
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "accesstoken":      (string),
      "refreshtoken":     (string),
      "user":             (userobject)
    }
    
Verify e-mail
/authentication/

Verify the users email address. The user gets a link with /verify/{id}/{verification_code}

  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          "userid":             (string),
          "verification_code":  (string)
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "accesstoken":      (string),
      "refreshtoken":     (string),
      "user":             (userobject)
    }
    
Deletes a user
/authentication/

[LOGIN REQUIRED]

  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          "id":       (string)   // Hashid of the user
          "password": (string)   // The user has to verify his password
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "success" : (boolean)
    }
    

Session management 

Login
/authentication/session

Normal authentification with credentials or Facebook-Connect. For FB-Connect you need to sign-in client-side to receive an accesstoken from Facebook. When you use Facebook-Connect, ask for the following fields: name,gender,age_range,email

The normal login method forbids to transmit the password in plain text. Use md5-hashing. It is not secure but it is just that “We don’t want to know the users password at any time.”.

  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          // For Normal
          "login_method":     "normal"
          "emailusername":   (string),
          "password":        (md5-string)
    
          // For Facebook
          "login_method":    "facebook"
          "fb_access_token":  (string),
          "fb_user_id":       (string)
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "accesstoken":      (string),
      "refreshtoken":     (string),
      "user":             (userobject)
    }
    
Logs out a user
/authentication/session

[LOGIN REQUIRED]

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "valid" : (boolean)
    }
    

Refresh your access token 

Refresh access token after 419
/authentication/refresh/
  • Request
  • Headers
    Content-Type: application/json
    refreshtoken: (string)
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "accesstoken": (string),
      "refreshtoken": (string),
      "user": (userobject)
    }
    

Check if still logged in 

Is the users access token still valid
/authentication/check/
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "valid" : (boolean)
    }
    

Forgot password 

Sends the user an email to reset his password

Creates a password reset possibility
/authentication/forgotpassword/
  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          "usernameoremail": (string)
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "valid" : (boolean)
    }
    

Reset password 

Resets the users password and responds with a new session

Resets the password
/authentication/resetpassword/
  • Request
  • Headers
    Content-Type: application/json
    Body
        {
          "resetcode": (string),
          "newpassword": (string)
        }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "accesstoken" : (string),
      "refreshtoken" : (string),
      "user": (userobject)
    }
    

Stomts 

stomt 

stomt-related resources

A single stomt object. The stomt resource is the central resource in the stomt API. It represents one paste - a single stomt.

Creates a stomt
/stomts

[LOGIN REQUIRED]

This is how the process works:

  1. The user selects between “I wish” (negative=true) and “I like”(negative=false)
  2. The user searches for a target.
  3. Submit stomt with either src_id and src OR target_id (if src = s, the src_id equals the targets ID
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
    "target_id": (integer),       // Unique targets hash-id
    // OR
    "src_id":    (string)         // Unique thirdparty specific ID
    "src":       (string)         // Thirdparty-type
    
    "negative" : (boolean),       // true = "I wish", false = "I like"
    "text" :     (string),        // The users text (maxlength: 100 chars)
    "anonym" :   (boolean),       // true = anonym, false = not anonym
    "img" :      (string)         // Base64 encoded STRING
    }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        'id' : (string),
    
        'creator' : {
          'name':  (string),
          'id'  :  (string),
          'uri':   (string)(web),
          'photo': (string)   // Photoname | Only if exists
        },
    
        'text' :   (string),
        'photo':   (string),  // Photoname | Only if exists
        'negative':(boolean),
    
        'target' : {
            'name':   (string),
            'id'  :   (string),
            'uri':    (string)(web),
            'photo':  (string) // Only if exists
        },
    
        'created_at' : (string),
        'anonym'            : (boolean),
        'amountAgreements'  : (integer),
        'amountComments'    : (integer)
    
        // Only exists if (dios-agreed
        'agreed': {
            'id': (string), // Hashed ID of the agreement
            'negative': (boolean)
        }
    }
    

Read 

Reads a single stomt
/stomts/{stomt_id}
  • Parameters
  • id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        'id' : (string),
    
        'creator' : {
          'name':  (string),
          'id'  :  (string),
          'uri':   (string)(web),
          'photo': (string)   // Photoname | Only if exists
        },
    
        'text' :   (string),
        'photo':   (string),  // Photoname | Only if exists
        'negative':(boolean),
    
        'target' : {
            'name':   (string),
            'id'  :   (string),
            'uri':    (string)(web),
            'photo':  (string) // Only if exists
        },
    
        'created_at' : (string),
        'anonym'            : (boolean),
        'amountAgreements'  : (integer),
        'amountComments'    : (integer)
    
        // Only exists if (dios-agreed
        'agreed': {
            'id': (string), // Hashed ID of the agreement
            'negative': (boolean)
        }
    }
    

Delete 

Deletes a single stomt
/stomts/{stomt_id}

[LOGIN REQUIRED]

  • Parameters
  • stomt_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

  • Response  200
  • Headers
    Content-Type: application/json
    Body
      {
        "success" : (boolean)
      }
    

Agreements 

agreement 

agreement-related resource

A single agreement object.

In case the user already agreed and wants to revoke his (dis-)agreement, we do not want you to update the negative-attribute of the existing agreement via PUT. Just DELETE the old (dis-)agreement and POST a new one.

Creates
/stomts/{stomt_hashid}/agreements

[LOGIN REQUIRED]

  • Request
  • Headers
    Content-Type: application/json
    Body
    {
    "negative": (boolean),    // true = disagreement, false = agreement
    "anonym":   (boolean),    // true, false
    }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
    "negative": (boolean),    // true = disagreement, false = agreement
    "anonym":   (boolean),    // true, false
    }
    
Delete
/stomts/{stomt_hashid}/agreements

[LOGIN REQUIRED]

  • Response  200
  • Headers
    Content-Type: application/json
    Body
      {
        "success" : (boolean)
      }
    

Comments 

comment-related resources

A stomt can have comments. We have two type of comments:

1st-level comments: That means comments which are directly posted under a stomt. They can be voted and may also have “subcomments”.

Subcomments: Subcomments are comments which are posted under an existing comment. They can not be voted and it is not possible to post a subcomment under a subcomment.

Comments 

Read comments of a stomt
/stomts/{stomt_id}/comments
  • Parameters
  • stomt_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        'id' :      (string),
    
        'creator' : {
          'name':   (string),
          'id':     (string),
          'url':    (string)(web),
        },
    
        'comment':  (string),
    
        'created_at': (string),
        'anonym':     (boolean),
    
        // Only if it is not a subcomment
        'amountSubcomments':  (integer), 
        'amountVotes':        (integer),
    
        // Only if it is not a subcomment
        // Only if subcomments exist
        'subs': [ // Array of sub-comments
            {
                'id' :      (string),
    
                'creator' : {
                  'name':   (string),
                  'id':     (string),
                  'url':    (string)(web),
                },
    
                'comment':  (string),
    
                'created_at': (string),
                'anonym':     (boolean)
            }
        ],
    
        // Only if it is not a subcomment
        // Only exists if (dis-)agreed
        'voted': {
            'id': (string), // Hashed ID of the agreement
            'negative': (boolean)
        },
    
    }
    
Creates a comment
/stomts/{stomt_id}/comments

[LOGIN REQUIRED]

This is how the process works:

  • Parameters
  • stomt_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

  • Request
  • Headers
    Content-Type: application/json
    Body
    {
    "parent_id": (string)|null   // hashid of the parent OR null
    "comment":   (string)        // comment
    }
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
        'id' :      (string),
    
        'creator' : {
          'name':   (string),
          'id':     (string),
          'url':    (string)(web),
        },
    
        'comment':  (string),
    
        'created_at': (string),
        'anonym':     (boolean),
    
        // Only if it is not a subcomment
        'amountSubcomments':  (integer), 
        'amountVotes':        (integer),
    
        // Only if it is not a subcomment
        // Only if subcomments exist
        'subs': [ // Array of sub-comments
            {
                'id' :      (string),
    
                'creator' : {
                  'name':   (string),
                  'id':     (string),
                  'url':    (string)(web),
                },
    
                'comment':  (string),
    
                'created_at': (string),
                'anonym':     (boolean)
            }
        ],
    
        // Only if it is not a subcomment
        // Only exists if (dis-)agreed
        'voted': {
            'id': (string), // Hashed ID of the agreement
            'negative': (boolean)
        },
    
    }
    

Delete 

Deletes a single comment
/stomts/{stomt_id}/comments/{comment_id}

[LOGIN REQUIRED]

  • Parameters
  • stomt_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

    comment_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a comment

  • Response  200
  • Headers
    Content-Type: application/json
    Body
      {
        "success" : (boolean)
      }
    

Vote-a-comment 

A single vote on a comment

In case the user already voted and wants to revoke his voting, we do not want you to update the negative-attribute of the existing comment via PUT. Just DELETE the old voting and POST a new one.

Create 

Create
/stomts/{stomt_id}/comments/{comment_id}/votes

[LOGIN REQUIRED]

  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "negative":  (boolean)    // false = "not negative" = positive = UPVOTE | true = DOWNVOTE
    }
    
  • Response  200
  • Body
    {
        "success": (boolean)
    }
    
Revokes a vote
/stomts/{stomt_id}/comments/{comment_id}/votes

[LOGIN REQUIRED]

  • Parameters
  • stomt_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a stomt

    comment_id
    string (required) Example: 7n5c62n75v2n6o5fn5

    hashid of a comment

  • Response  200
  • Headers
    Content-Type: application/json
    Body
      {
        "success" : (boolean)
      }
    

Targets 

target 

Targets are the most important and complex resources. stomt is built to feedback anything, even friends and general things (e.g. I wish life had a pause button). Therefore nearly anything is saved as a Target and depending on its type additional type specific data.

Currently available target types:

  • user

User specific details

  'details': {
    'id':         (string),     // Hashid
    'slug':       (string)(web),// URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
    'name':       (string),     // Name
    'description':(string),     // Max. 100 Chars
    'website':    (string),
    'fullname':   (string),
    'gender':     (string),     // male | female
    'email':      (string),
    'password':   (string),     // only writeable, not readable
    'lang':       (ISO 639-1),  // en/de
    'photo': {
         'sidebar_profile': (string),     // Only if exists
         'header_profile':  (string),     // Only if exists
    },
    'birth': {
        'day':    (integer),
        'month':  (integer),
        'year':   (integer)
    }

    // Not editable!
    'influencestatus': {
        'actualInfluencePoints': (integer)        // Actual amount of influence points
        'actualInfluenceLevel': (integer)         // Actual influencelevel
        'nextLevel': (integer)                    // Next influencelevel (actualInfluenceLevel + 1)
        'nextLevelPoints': (integer)              // Amount needed to reach the next level
        'nextLevelPointsDifference': (integer)    // Amount of points missing to reach the next level
        'influenceLevelBarPercentage': (integer)  // Percentage of points where next Level is 100%
        'influenceLevelBarWidthPx': (integer)     // optional | requires influence-bar-length
                                                  // via ?influenceBarMaxWidth parameter (pixel)
    }
  }

User specific statistics:

    'stats': {
        'amountFollowers':  (integer),
        'amountFollows':    (integer),
        'amountStomts':     (integer)
    }
  • venue

Venue specific details

  'details': {
    'description':  (string),
    'address':      (string),
    'city':         (string),
    'country':      (string),
    'tel':          (string)
  }

Venue specific statistics:

    'stats': {
        'amountFollowers':  (integer),
        'amountStomts':     (integer)
    }

Embed data

To add the target specific details, append ?embed=details. This will include a pre-defined target-specific (see above) dataset into the result.

If you just want to add a specific detail just name it directly. E.g. you want to have the users e-mail address. Just append ?embed=email or ?embed=email,website Use punctuation to retrieve nested variables: ?embed=birth.year

Create a target
/targets/{id}

Use /targets instead of /targets/{id}. Aglio (this documentation tools) has here a lack of functionality.

Here is currently only one method allowed. After choosing a target in a stomt creation process and if this targets source is not s for stomt, send a POST request

  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "creation_method":  (string),     // Only supported method: "prefetch"
        "src":              (string),     // g = googleplaces, s = stomt
        "src_id":           (string),     // API specific unique id
        "context":          (string)      // Supported: stomt_creation (optional), normal_search (required)
    }
    
  • Response  200
  • Body
    {
        // Depending on context
        // stomt_creation:
        "success": (boolean)
    
        // normal_search
        "uri":      (string)(web)
        "id":       (string)(native)
    
    }
    
Get a specific target
/targets/{id}
  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      'id':           (hashid),
      'displayname' : (string),
      'slug':         (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
      'type':         (string),
      'photo':        (array),              // Only if exists (May contain: 'target_profile' and 'target_cover'
      'details':      (object)              // optional | embed=details; target specific
    }
    

Target:Details 

Get a specific target
/target/{id}?embed={?var}

You’ll receive the standard-target and the type-specific data embed.

  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      'id':           (hashid),
      'displayname' : (string),
      'slug':         (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
      'type':         (string),
      'photo':        (array),              // Only if exists (May contain: 'target_profile' and 'target_cover'
      'details':      (object)              // optional | embed=details; target specific
    }
    

Target:Details 

[LOGIN REQUIRED]

Change target-type specific data
/target/{id}/details

Simply send the complete target including its details.

  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Request
  • Headers
    Content-Type: application/json
    Content-Type: application/json
    Body
    {
      'id':           (hashid),
      'displayname' : (string),
      'slug':         (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
      'type':         (string),
      'photo':        (array),              // Only if exists (May contain: 'target_profile' and 'target_cover'
      'details':      (object)              // optional | embed=details; target specific
    }
    
  • Response  200
  • Body
      {
        'success': (boolean)
      }
    

Target:Stomts 

Get stomts related to a specific target
/targets/{id}/stomts/{type}/{secondType}
  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

    type
    string (required) Example: created

    What to show: received or created stomts?

    Choices: received created

    secondType
    string (optional) Example: positive

    All of type typeor just the negative or positive ones?

    Choices: positive negative

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      'id':           (hashid),
      'displayname' : (string),
      'slug':         (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
      'type':         (string),
      'photo':        (array),              // Only if exists (May contain: 'target_profile' and 'target_cover'
      'details':      (object)              // optional | embed=details; target specific
    }
    

Target:Follows 

Get a collection of targets a specific target is following
/targets/{id}/follows
  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Response  200
  • Headers
    Content-Type: application/json
    Body
    [
      {
        'target_id':      (hashid),
        'displayname':    (string),
        'slug':           (string)(web),    // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
        'type':           (string),
        'photo':          (URL string),
        'influencelevel': (integer),
        'amIFollowing':   (boolean),        // Current user following? userid-header required
        'memberSince':    (string)          // 234 years
      }
    ]
    

Target:Followers 

Read
/targets/{id}/followers
  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Response  200
  • Body
    [
      {
        'target_id':      (hashid),
        'displayname':    (string),
        'slug':           (string)(web), // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
        'type':           (string),
        'photo':          (string),   // Only if exists
        'influencelevel': (integer),  // Only users
        'amIFollowing':   (bool),     // Only users | Current user following? userid-header required
        'memberSince':    (string),   // Only users | 234 years
        'info':           (string),   // Only Non-users
        'amountFollower': (integer)
      }
    ]
    
Follow
/targets/{id}/followers

[LOGIN REQUIRED]

  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target to be followed

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Body
    [
      {
        'id':             (hashid),
        'displayname':    (string),
        'slug':           (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
        'type':           (string),
        'photo':          (URL string),
        'influencelevel': (integer),
        'amIFollowing':   (bool),       // Current user following? userid-header required
        'memberSince':    (string)       // 234 years
      }
    ]
    
Unfollow
/targets/{id}/followers

[LOGIN REQUIRED]

  • Parameters
  • id
    string (required) Example: 622df9169fe84f1c81ff9d841

    The unique hashid of the target

  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Body
    [
      {
        'id':             (hashid),
        'displayname':    (string),
        'slug':           (string)(web),        // URI-Version of the name. E.g. "Hans Peter" => "Hans-Peter"
        'type':           (string),
        'photo':          (URL string),
        'influencelevel': (integer),
        'amIFollowing':   (boolean),       // Current user following? userid-header required
        'memberSince':    (string)         // 234 years
      }
    ]
    

Changelog 

  • 07.10.2014 - v0.2.1
    • You do no need to send target_id_followed when deleting a follower-relation. It was wrong documented.
    • You do not need the prefetch-call in the stomt-creation process. For normal search this process is still necessary.
    • Changed agreements route from /agreements to /stomts/{stomt_hashid}/agreements And also removed “stomt_id” as required attribute as we can get it from URI. Counts for creation and deletion of agreements.
    • If you verify a user you’ll receive his login-data
    • Changed accessToken and refreshToken to lowercase: accesstoken, refreshtoken (everywhere)
    • You do not need to send me the comment-vote-id anymore. just send me a DELETE req. to /stomts/{stomt_id}/comments/{comment_id}
  • 30.09.2014

  • 22.09.2014

    • Password have now to be transmitted as simple md5-hash. Even if md5 is not so secure: We don’t want to know the plain text password at any time. Affected are: registration, normal login, delete user

    • The stomt creation process changed to ensure fast autocomplete while reducing time and complexity of the stomt-creation itself.

    • It is now default that a created stomt has an initial first agreement.

    • A lot of database changes are made. Reset and migrate your database.

Backend Install 

This is the installation guide for Windows. I assume Linux users to be clever enough to anticipate the following steps.

1. Install pre-requiries

Install a webserver and MySQL

Just use XAMPP

https://www.apachefriends.org/de/index.html

Install git

http://msysgit.github.io/

Install composer

https://getcomposer.org/

2. Setup database

Create a database called stomt_backend.

3. Setup virtual host

Add following to your Apache2 Config (C:/xampp/apache2/conf/extra/httpd-vhosts.conf)

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/stomt/backend/public"
    ServerName rest.local.stomt.com
    ServerAlias rest.local.stomt.com
</VirtualHost>

Add following line to your hosts-file

Add: 127.0.0.1 rest.local.stomt.com To: C:/Windows/System32/drivers/etc/hosts.

Open it with an Editor in administrator-mode. Add line, save. You do not have to restart your computer. hosts-file changes take effect immediately.

4. Pull the code

Use the develop branch to develope and the master branch to test your client-application against. master is always the current working version.

git clone git@git.stomt.com:stomt/backend.git

5. Install backend dependencies

Go to the backend directory and composer install.

6. Install migrations

php artisan migrate

7. Last step

Restart the webserver and use the base data to test the backend.

Troubleshooting 

I get a same-origin policy error

Something in the backend is broken or the backend is down. Should not happen.

I get a 419 error

Use your refresh token.

The backend “doesn’t work” anymore

The master branch should always work. Sometimes the path structures for composers autoload function needs to be updated. Please try to do the following four steps:

  1. Go into the backends root directory
  2. Update composer by composer self-update
  3. Update all dependencies by composer update
  4. Update the autoloader again by composer dump-autoload to add custom libraries

Homestead 

Installation

1. Install dependencies

Install vagrant and VirtualBox:

2. Install Laravel/Homestead from terminal

vagrant box add laravel/homestead

3. Choose a central Homestead directory

git clone https://github.com/laravel/homestead.git Homestead

4. Add your SSH-Key

Specify the key’s path in the authorize property of your Homestead.yaml file.

5. Edit your hosts-file

Linux: /etc/hosts Windows: C:\Windows\System32\drivers\etc\hosts

Add: 127.0.0.1 homestead.app

6. Configure NGINX

Add following code to your Homestead.yaml

    sites:
        - map: homestead.app
          to: /home/vagrant/Code/Laravel/public
          hhvm: true

7. Start using Vagrant / Laravel Homestead

run the vagrant up command from the Homestead directory in your terminal

Usage

Run vagrant ssh from your Homestead-Directory.

Content Attribution 

Google

Src-Type: g

Generated by aglio on 10 Oct 2014