API Documentation Current version 1.0.3

まずアクセス初期時にユーザーID、パスワードをリクエストヘッダーにセットしてアクセスする必要があります。

メソッド

GET

URL

https://timeslist.com/api/login/

Query Parameter

名前 形式 説明 複数指定(※1)
user_id (必須) char header TIMESLIST内のユーザーID(BASE64エンコード)
password (必須) char header TIMESLIST内のパスワード(BASE64エンコード)


※1 複数指定が可の場合はカンマ(,)で区切る

Return Parameter

名前 説明
return_code integer APIリターンコード
api_accesskey char APIアクセスキー

実装例

                
var tml_api_accesskey = "";
var domain = "https://timeslist.com/";

function tml_api_login()
{
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function ()
    {
        if (xhr.readyState == 4) {
            if (xhr.status == 200) {
                var res = JSON.parse(xhr.responseText);
                if (res['return_code'] == 0) {
                    tml_api_accesskey = res['accesskey'];
                }
            }
        }
    };

    loginid = document.getElementById('loginid').value;
    pass = document.getElementById('pass').value;

    if (loginid == "" || pass == "") {
        alert("input error");
        return;
    }

    xhr.open("GET", domain + "api/login");
    xhr.setRequestHeader("Timeslist-User", Base64.encode(loginid));
    xhr.setRequestHeader("Timeslist-Password", Base64.encode(pass));
    xhr.send(null);
}

                
                
©2016 TIMESLIST