On premise authentication

ManicTime Server API

You can use ManicTime Server API in order to programmatically access timeline data using Timeline API.

Authentication - Windows users

When server is configured with Windows users, Kerberos or NTLM is used for authentication. Please use a client HTTP library that supports these protocols.

Authentication - ManicTime users

When server is configured with ManicTime users, OAuth 2.0 is used for authentication. Oauth 2.0 Resource Owner Password Flow is used, where after sending username and password your app gets access token. You use access token in order to make authorized API calls.

You need to follow these steps in order to get and use access token:

1. Get token endpoint URL
2. Get access token
3. Call API

1. Get token endpoint URL

To get token endpoint URL, make HTTP call without authorization headers

GET http://localhost:8080/api
Accept: application/vnd.manictime.v3+json 
HTTP/1.1 401 Unauthorized
Content-Type: application/vnd.manictime.v3+json charset=utf-8
WWW-Authenticate: Bearer

{ 
    "links": [   
        {      
            "rel": "manictime/token",
            "href": "http://localhost:8080/api/token"    
        }  
    ]
}

2. Get access token

To get access token, call token endpoint URL with username and password

POST http://localhost:8080/api/token
Content-Type: application/x-www-form-urlencoded
Accept: application/vnd.manictime.v3+json

grant_type=password&username=<username>&password=<password>
HTTP/1.1 200 OK
Content-Type: application/json

{  
    "token": <access_token>
}

3. Call API

You can need to include access token with each API call.

GET http://localhost:8080/api
Authorization: Bearer <access_token>
Accept: application/vnd.manictime.v3+json
HTTP/1.1 200 OK
Content-Type: application/vnd.manictime.v3+json; charset=utf-8

{
    "links": [
        {
            "rel": "self",
            "href": "http://localhost:8080/api/"
        },
        {
            "rel": "manictime/timelines",
            "href": "http://localhost:8080/api/timelines"
        },
        {
            "rel": "manictime/environments",
            "href": "http://localhost:8080/api/environments"
        },
        {
            "rel": "manictime/screenshots",
            "href": "http://localhost:8080/api/screenshots"
        },
        {
            "rel": "manictime/clientState",
            "href": "http://localhost:8080/api/clientState"
        },
        {
            "rel": "manictime/tagcombinationlist",
            "href": "http://localhost:8080/api/tagcombinationlist"
        },
        {
            "rel": "manictime/clientsettings",
            "href": "http://localhost:8080/api/clientSettings"
        }
    ]
}