EnviroCar Service

Developer Guide

API Reference

Linked Open Data

Additional encodings for tracks

/users/:username/friends

This is the Friends resource.

GET

Get a list of friends of the user username.

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"
        }
    ]
}

POST

Adds a user as a friend to user username.

Request Schema

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

/users/:username/friends/:friend

GET

Get a specific friend friend of the user username.

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"
}

DELETE

Removes a specific friend friend of the user username.