EnviroCar Service

Developer Guide

API Reference

Linked Open Data

Additional encodings for tracks

/users

GET

Get a list of all users.

Response Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://schema.envirocar.org/users.json#",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "users"
    ],
    "properties": {
        "users": {
            "type": "array",
            "minItems": 0,
            "items": {
                "$ref": "http://schema.envirocar.org/user.json#"
            }
        }
    }
}

Response Example

{
    "users": [
        {
            "name": "test1",
            "mail": "test1@example.de",
            "created": "2013-06-25T09:56:13Z",
            "modified": "2013-07-01T14:19:19Z"
        },
        {
            "name": "test2",
            "mail": "test2@example.de",
            "created": "2013-06-25T07:56:10Z",
            "modified": "2013-07-01T18:19:36Z"
        }
    ]
}

/users/:user

GET

Get the user user.

Response Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://schema.envirocar.org/user.json#",
    "type": "object",
    "required": [
        "name"
    ],
    "allOf": [
        {
            "$ref": "http://schema.envirocar.org/definitions.json#/optional-user-properties"
        },
        {
            "properties": {
                "created": {
                    "type": "string",
                    "format": "date-time"
                },
                "mail": {
                    "$ref": "http://schema.envirocar.org/definitions.json#/mail"
                },
                "modified": {
                    "type": "string",
                    "format": "date-time"
                },
                "name": {
                    "$ref": "http://schema.envirocar.org/definitions.json#/username"
                }
            }
        }
    ]
}

Response Example

{
    "country": "Germany",
    "created": "2013-06-25T09:56:13Z",
    "dayOfBirth": "1989-01-01",
    "firstName": "Jakob",
    "gender": "m",
    "language": "de-DE",
    "lastName": "M",
    "mail": "jakob@jakob.de",
    "modified": "2013-07-10T08:30:04Z",
    "name": "jakob1"
}

POST

Creates a new user.

Request Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://schema.envirocar.org/user.create.json#",
    "type": "object",
    "required": [
        "name",
        "mail",
        "token"
    ],
    "allOf": [
        {
            "$ref": "http://schema.envirocar.org/definitions.json#/optional-user-properties"
        },
        {
            "properties": {
                "name": {
                    "$ref": "http://schema.envirocar.org/definitions.json#/username"
                },
                "mail": {
                    "$ref": "http://schema.envirocar.org/definitions.json#/mail"
                },
                "token": {
                    "type": "string"
                }
            }
        }
    ]
}

Request Example

{
    "name": "NewUserName",
    "mail": "test@testmail.com",
    "token": "testtoken"
}

PUT

Updates the user user.

Request Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://schema.envirocar.org/user.modify.json#",
    "type": "object",
    "allOf": [
        {
            "$ref": "http://schema.envirocar.org/definitions.json#/optional-user-properties"
        },
        {
            "properties": {
                "mail": {
                    "$ref": "http://schema.envirocar.org/definitions.json#/mail"
                },
                "token": {
                    "type": "string"
                }
            }
        }
    ]
}

Request Example

{
  "mail": "test@example.de",
  "token": "NewToken",
  "firstname": "NewFirstName",
  "lastname": "NewLastName"
}

DELETE

Deletes the user user.