1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Backlog APIで使用する 'userId' を取得する方法

Last updated at Posted at 2023-07-20

Backlog APIでは、よくuserIdを使用するのだが、このuserIdは個人設定で変更できるユーザーIDではなく、395853のような数値を使用する。

この395853のような数値は、Backlogの個人設定などからは取得できなかったため、Backlog APIを使用して取得する方法を備忘録として残しておきます。

プロジェクトのユーザー一覧を取得

Backlog APIのプロジェクトユーザー一覧の取得を実行して、ユーザー一覧(jsonデータ)を取得する。

ユーザー一覧からuserIdを取得

取得したユーザー一覧(jsonデータ)の中のidの値がuserIdになる。
次の場合、Yamada TaroさんのuserId111111になる。

[
    {
        "id":111111,
        "userId":null,
        "name":"Yamada Taro",
        ...省略...
    },
    {
        "id":222222,
        "userId":null,
        "name":"Nihon Hanako",
        ...省略...
    },
    ...省略...
]

補足事項

Backlog APIのユーザー一覧の取得でも取得可能だと思われる。こちらの場合は、管理者、または、プロジェクト管理者である必要があるため、未確認です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?