Accelo Web应用程序如何确定登录用户的“员工ID”?

时间:2017-02-12 00:08:42

标签: api oauth documentation

使用Accelo API的the 'Web Application' OAuth flow,哪里可以找到已登录用户的“员工ID”?

员工ID用于其他请求,例如Activities.

它似乎不会作为OAuth回调的一部分返回。

the /tokeninfo and /user端点也不提及它。

the /staff endpoints.

中甚至没有某种“whoami”方法

(目前,我依赖用户至少启动了一个Timer/timers?_fields=staff端点仅返回当前用户的计时器,并显示每个人的员工ID。)

(另外,应用程序不会在作用域中被授予write权限,因此无法创建虚拟计时器。)

1 个答案:

答案 0 :(得分: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": "Robert@example.com",
    "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": "Robert@example.com",
    "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": "robert@example.com"
  }
}