8000 Company API · mifort-org/mifort-timesheet Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Company API

Andrew Voitov edited this page Mar 19, 2016 · 1 revision

Get company by id

Property Value
Method GET
URL /api/v1/company/<companyId>
Parameters companyId
Content-Type application/json
Response:
{
    "_id": "55d041ef0232c58c2e9dae5c",
    "name": "Super company",
    "description": "Bla bla",
    "owner": "u1",
    "emails":[
        "test@test.com",
        "rest@email.ua"
    ],
    "template": {
        "date": "",
        "role": "",
        "time": "4",
        "comment": ""
    },
    "defaultValues": [
        {
            "date": "01/01/2015",
            "comment": "AAAAA"
        }
    ],
    "periods" : [
        {
            "start": "01/01/2015",
            "end": "02/01/2015"
        }
   ]
}

Create company (creates users by emails/ update project templates)

Property Value
Method PUT
URL /api/v1/company
Content-Type application/json
Body:
{
    "name":"Super Project",
    "description": "Bla bla bla",
    "template": {
        "date": "",
        "role": "",
        "time": "4",
        "comment": ""
    },
    "defaultValues": [
        {
            "date": "01/01/2015",
            "comment": "AAAAA"
        }
    ],
    "periods" : [
        {
            "start": "01/01/2015",
            "end": "02/01/2015"
        }
    ],
    "emails": [
     "test@test.test"
     ] 
}

Response:

{
    //saved object
}

Update company (creates users by emails/ update project templates)

Property Value
Method POST
URL /api/v1/company
Content-Type application/json
Body:
{
    "_id": "562a62c62aff89b82428001f",
    "name":"Super Project",
    "description": "Bla bla bla",
    "template": {
        "date": "",
        "role": "",
        "time": "4",
        "comment": ""
    },
    "defaultValues": [
        {
            "date": "01/01/2015",
            "comment": "AAAAA"
        }
    ],
    "periods" : [
        {
            "start": "01/01/2015",
            "end": "02/01/2015"
        }
    ],
    "emails": [
     "test@test.test"
     ] 
}

Response:

{
    //saved object
}
Clone this wiki locally
0