2017-02-12 53 views
1

使用Accelo API的the 'Web Application' OAuth flow,哪裏可以找到登錄用戶的「工作人員ID」?Accelo Web應用程序如何確定登錄用戶的「工作人員ID」?

工作人員ID在其他請求中使用,如Activities.

它似乎並沒有返回因爲OAuth回調的一部分。

也不是the /tokeninfoand /user端點提到它。

還有的甚至沒有中the /staff endpoints.


(就目前而言,我依靠用戶至少有一個Timer開始某種「WHOAMI」的方法。該/timers?_fields=staff端點只返回當前用戶的計時器,並顯示了每個工作人員的ID。)

(此外,應用程序將不會在範圍授予write權限,因此創建一個虛擬定時器是不可能的。)

回答

0

由於the quick work of the people at Accelo,工作人員用ID現已在幾個端點:

/staff/whoami

樣本響應:

{ 
    "meta": { 
    "message": "Everything executed as expected.", 
    "more_info": "https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok", 
    "status": "ok" 
    }, 
    "response": { 
    "firstname": "Robert", 
    "id": "23", 
    "surname": "Bell" 
    } 
} 

/tokeninfo

樣本響應:

{ 
    "meta": { 
    "message": "Everything executed as expected.", 
    "more_info": "https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok", 
    "status": "ok" 
    }, 
    "response": { 
    "deployment": "example", 
    "email": "[email protected]", 
    "expiry_date": "1412345678", 
    "firstname": "Robert", 
    "locale": { 
     "currency": { 
     "symbol": "$" 
     }, 
     "timezone": "Australia/Sydney" 
    }, 
    "staff_id": "23", 
    "surname": "Bell" 
    } 
} 

/user

樣本響應:

{ 
    "meta": { 
    "message": "Everything executed as expected.", 
    "more_info": "https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok", 
    "status": "ok" 
    }, 
    "response": { 
    "email": "[email protected]", 
    "fax": "", 
    "financial_level": "all", 
    "firstname": "Robert", 
    "id": "23", 
    "locale": { 
     "currency": { 
     "symbol": "$" 
     }, 
     "timezone": "Australia/Sydney" 
    }, 
    "mobile": "+61234567890", 
    "phone": "09 1234 5678", 
    "position": "Developer", 
    "surname": "Bell", 
    "timezone": "Australia/Sydney", 
    "title": null, 
    "user_access": { 
     "account_invoice": { 
     "add": 1, 
     "admin": 1, 
     "dashboard": "", 
     "manages": 0, 
     "view": 1 
     }, 
     "activity": { 
     "add": 1, 
     "admin": 1, 
     "dashboard": 1, 
     "manages": 0, 
     "view": 1 
     }, 
     // ... 
    }, 
    "user_titles": { 
     "account_invoice": { 
     "plural": "Invoices", 
     "singular": "Invoice" 
     }, 
     "account_purchase": { 
     "plural": "Purchases", 
     "singular": "Purchase" 
     }, 
     // ... 
    }, 
    "username": "[email protected]" 
    } 
} 
相關問題