API

JSON API

API

Entwurfsfassung

Allgemein

Die öffentliche API lässt nur lesende [GET] Zugriffe zu. Der Rückgabewert ist ein JSON-Object.
Als Beta steht dieser Aufruf zur Verfügung: 

https://api.emotionum.com/_ext/{get request}

Bsp.: https://api.emotionum.com/_ext/object/907

Parameter

Als zusätzliche Parameter können start={int < 101} und limit={int < 101} verwendet werden, um Listen zu begrenzen.

Bsp.: https://api.emotionum.com/_ext/object/?start=10&limit=20

Definition

 

Objects

/api/object

[GET]

List all public objects

/api/object/{id}

[GET]

Show public object details

/api/object/{id}/aggregation

[GET]

Show vote aggregation or animation for a public object

Optional parameters, examples:

?layers=network&networkId=1

?animation=1

?layers=network&networkId=1&animation=1

/api/object/{id}/similar

[GET]

Show similar objects for a public object

/api/object/{id}/vote

[GET]

(Forbidden)

/api/object/suggest

[GET]

Suggest public objects, give for example ?q=Gômez and receive:

[{"name":"Mario G\u00f3mez"}]

Give no less than 3 and no more than 15 characters

/api/object/search

[GET]

Search public objects using the search engine

Optional parameters, examples:

?sort=newestFirst [newestFirst|captionAsc|dobAsc|dobDesc|mostRates|leastRates|mostPlaylists]

?query=Podolski

?classId=1 [1|2]

?fifaCountry=BRA

?fieldPosition=offensiv [offensive|midfield|defensive|goal]

?yearFrom=1987

?yearTo=2002

?age=17

Classes

/api/class

[GET]

List all available classes (players and goalkeepers so far)

/api/class/{id}

[GET]

Show details on a specific class

/api/class/{id}/object

[GET]

Show all public objects for a given class

Networks

/api/network

[GET]

List all public networks

/api/network/{id}

[GET]

Get details for a public network

/api/network/search

[GET]

Search public networks using the search engine

Optional parameters, examples:

?sort=newestFirst [newestFirst|captionAsc]

?query=Hamburg

/api/network/{id}/user

[GET]

List all (public) users that are in a (public) network

/api/network/{id}/object

[GET]

List all (public) objects that are in a (public) network

/api/network/{id}/object/search

[GET]

Search public objects prefiltered by (public) network

Playlists

/api/playlist xxx

[GET]

List all public playlists

/api/playlist/{id}

[GET]

Get details for a public playlist

/api/playlist/{id}/object

[GET]

List all (public) objects that are in a (public) playlist

/api/playlist/{id}/object/search

[GET]

Search public objects prefiltered by (public) playlist

/api/user

[GET]

Show all public users

/api/user/{id}

[GET]

Get information on a (public) user

/api/user/signin

[POST]

Method for signin (login)

{ "name": "my.username", "password": "newPassword123" }

/api/user/signout

[POST]

Method for signout (logoff)

{  }

 

/api/user/suggest

[GET]

Suggest public users, give for example ?q=Meier and receive:

[{"name":"Peter Meier"}]

Give no less than 3 and no more than 15 characters

/api/user/search

[GET]

Search public users using the search engine

Optional parameters, examples:

?sort=newestFirst [newestFirst|captionAsc|lastNameAsc|lastNameDesc]

?query=Meyer

/api/user/{id}/network

[GET]

List all (public) networks of a (public) user

/api/user/{id}/playlist

[GET]

List all (public) playlists of a (public) user

/api/user/{id}/personification

[GET]

List all (public) objects that are impersonated by a (public) user

/api/user/{id}/followers

[GET]

(Access denied)

/api/user/{id}/vote

[GET]

List all votes for a (public) user

(for internal use)

Private, specific user related methods

  • For all methods here, a given user must be signed in, thus providing a valid session token in the authorization header

/api/my/{id}/playlist

[GET]

List all my playlists

/api/my/{id}/playlist/{id}

[GET]

Show specific information for one of my playlists

/api/my/{id}/playlist/{id}/object

[GET]

List all objects in one of my playlists

/api/my/{id}/network

[GET]

List all my networks

Possible filter query:

?role=[owner|member|importOwn]

/api/my/{id}/network/{id}

[GET]

Show specific information for one of my networks

/api/my/{id}/network/{id}/object

[GET]

List all objects in one of my networks

/api/my/{id}/network/{id}/object/{id}

[GET]

Check if a given object is in a given network

/api/my/{id}/network/{id}/user

[GET]

List all users (members) in one of my networks

/api/my/{id}/network/{id}/friend

[GET]

List all members in one of my networks that are befriended with me

/api/my/{id}/object

[GET]

List all my objects

/api/my/{id}/object/{id}

[GET]

Get details on one of my objects

/api/my/{id}/object/{id}/similar

[GET]

Show similar objects to one of my objects

/api/my/{id}/object/{id}/aggregation

[GET]

Show aggregations/animations to one of my objects

Parameters, examples:

?layers=network%2Cself&networkId=4

?layers=followed%2Cfollowers

?layers=friends

?layers=self&animation=1

/api/my/{id}/object/{id}/vote

[GET]

List votes on one of my objects

/api/my/{id}/object/{id}/latestVote

[GET]

Get my latest vote on a specific object

/api/my/{id}/vote

[GET]

List all my votes

/api/my/{id}/vote/{id}

[GET]

Get details on one of my votes

/api/my/{id}/user

[GET]

List all users for user {id} (only myself)

/api/my/{id}/user/{id}

[GET]

Show a user profile in a private context

/api/my/{id}/user/{id}/personification

[GET]

Show personificated objects of a user in a private context

Optional parameter filters result for own records:

?own

Optional parameter filters result for public records:

?public

/api/my/{id}/invitation

[GET]

Show my invitations (where i was invited) plus my applications (where i applied to)

Optional parameter filters result for all my networks:

?dashboard

/api/my/{id}/invitation/{id}

[GET]

Show further details on one of my inviations/applications

/api/my/{id}/user/{id}/followers

[GET]

List the users following me

/api/my/{id}/user/{id}/followed_users

[GET]

List the users i follow

/api/my/{id}/user/{id}/followed_networks

[GET]

List the networks i follow

/api/my/{id}/network/{id}/invitation

[GET]

Show invitations/applications to a given network where i am an owner

/api/my/{id}/network/{id}/object/search

[GET]

Search objects in a network context

/api/my/{id}/playlist/{id}/object/search

[GET]

Search objects in a playlist context

/api/my/{id}/network/{id}/user/search

[GET]

Search users in a network context

/api/my/{id}/network/{id}/followers

[GET]

List all followers of a network

Tags

json | api | code

Version

Mittwoch, 10. August 2016