Skip to content

Specification of the REST API

ASOBOLEV edited this page Feb 24, 2014 · 8 revisions

An overall proposal: change 'conference' to 'event' (shorter).

Interface definitions

# Home page
GET         /                              controllers.Application.index

# Map static resources from the /public folder to the /assets URL path
GET         /assets/*file                  controllers.Assets.at(path="/public", file)

# Conference interface
POST        /conferences                   controllers.Conferences.create()
GET         /conferences                   controllers.Conferences.list()
GET         /conferences/:id               controllers.Conferences.get(id: String)
PUT         /conferences/:id               controllers.Conferences.update(id: String)
DELETE      /conferences/:id               controllers.Conferences.delete(id: String)
POST        /conferences/:id/abstracts     controllers.Abstracts.create(id: String)
GET         /conferences/:id/abstracts     controllers.Abstracts.listByConference(id: String)
PUT         /conferences/:id/owners        controllers.Conferences.setPermissions(id: String)
GET         /conferences/:id/owners        controllers.Conferences.getPermissions(id: String)

# Abstract interface
GET         /abstracts/:id                 controllers.Abstracts.get(id: String)
PUT         /abstracts/:id                 controllers.Abstracts.update(id: String)
DELETE      /abstracts/:id                 controllers.Abstracts.delete(id: String)
POST        /abstracts/:id/figure          controllers.Files.upload(id: String)
GET         /abstracts/:id/figure          controllers.Files.download(id: String)
DELETE      /abstracts/:id/figure          controllers.Files.delete(id: String)
PUT         /abstracts/:id/owners          controllers.Abstracts.setPermissions(id: String)
GET         /abstracts/:id/owners          controllers.Abstracts.getPermissions(id: String)

# [...] maybe add more aliases

# Account interface
GET         /user                          controllers.Application.showUserInfo
GET         /user/:id/abstracts            controllers.Abstracts.listByAccount(id: String)
GET         /secret                        controllers.Application.showSecret

# Login page
GET         /login                         securesocial.controllers.LoginPage.login
GET         /logout                        securesocial.controllers.LoginPage.logout

# User Registration and password handling
GET         /signup                        securesocial.controllers.Registration.startSignUp
POST        /signup                        securesocial.controllers.Registration.handleStartSignUp
GET         /signup/:token                 securesocial.controllers.Registration.signUp(token)
POST        /signup/:token                 securesocial.controllers.Registration.handleSignUp(token)
GET         /reset                         securesocial.controllers.Registration.startResetPassword
POST        /reset                         securesocial.controllers.Registration.handleStartResetPassword
GET         /reset/:token                  securesocial.controllers.Registration.resetPassword(token)
POST        /reset/:token                  securesocial.controllers.Registration.handleResetPassword(token)
GET         /password                      securesocial.controllers.PasswordChange.page
POST        /password                      securesocial.controllers.PasswordChange.handlePasswordChange

# Providers entry points
GET         /authenticate/:provider        securesocial.controllers.ProviderController.authenticate(provider)
POST        /authenticate/:provider        securesocial.controllers.ProviderController.authenticateByPost(provider)
GET         /not-authorized                securesocial.controllers.ProviderController.notAuthorized

JSON examples

###Conference:

{
    "uuid": "some-uuid",
    "name": "Conference name",
    "abstracts": "http://hostname:port/conferences/id/abstracts"
}

###Account:

{
    "uuid": "some-uuid",
    "mail": "[email protected]",
    "abstracts": "http://hostname:port/account/id/abstracts"
}

###Abstract:

{
    "uuid": "some-uuid", 
    "title": "Web Data Storage ...", 
    "topic": "Neural encoding and ...", 
    "text": "Recent advancements in ...", 
    "doi": "10.12751/test.23", 
    "conflictOfInterest": "The authors declare that ...", 
    "acknowledgements": "Supported by ...", 
    "approved": true,
    "published": true,
    "figure": {
        "uuid": "some-uuid",
        "name": "filename",
        "caption": "File description goes here..",
        "file": "http://hostname:port/abstract/id/figure"
    },
    "owners": "http://hostname:port/abstract/id/owners",
    "authors": [
        {
            "uuid": "some-uuid",
            "mail": "[email protected]",
            "first_name": "Robert",
            "middle_name": null,
            "last_name": "Bolson",
            "correspondence": true,
            "affiliations": ["some-uuid"]
        }, 
        {
            "uuid": "some-uuid",
            "mail": "[email protected]",
            "first_name": "Freddy",
            "middle_name": "Charles",
            "last_name": "Krueger",
            "correspondence": false,
            "affiliations": ["some-uuid", "other-uuid"],
        }
    ],
    "affiliations": [
        {
            "uuid": "some-uuid",
            "address": "Department ...",
            "country": "Germany",
            "department": "Biologie",
            "name": "University ...",
            "section": null
        },
        {
            "uuid": "some-uuid",
            "address": "Department ...",
            "country": "France",
            "department": "CNS",
            "name": "University ...",
            "section": null
        }
    ],
    "references": [
        {
            "authors": "G-Node",
            "title": "G-Node Repository (http://g-node.github.com)",
            "year": 2013,
            "doi": null
        },
        {
            "authors": "Neuralensemble",
            "title": "NEO I/O (http://neuralensemble.org/neo)",
            "year": 2013,
            "doi": null
        }
    ]
}

###Owners

[
    "some-uuid",
    "other-uuid"
]
Clone this wiki locally