技術と本について書くブログ

技術と本について書くblog。技術メモなど雑記を書いているblog。

app store connect apiでUSERを削除する

App Store Connect APIでユーザーの参照

GET https://api.appstoreconnect.apple.com/v1/users

https://developer.apple.com/documentation/appstoreconnectapi/list_users クエリパラメーターと叩き方例

一覧を取る(一度に取れるのは50まで)

最初にトークンを取得しておく

token=$(ruby apc.rb)
curl https://api.appstoreconnect.apple.com/v1/users?limit=50 -H "Authorization: Bearer $token" 

usernameを絞って取得

curl https://api.appstoreconnect.apple.com/v1/users?filter[username]=hoge@exapmle.com -H "Authorization: Bearer $token" --globoff

globoffはパラメーター内にや{}などがあるときに使います。filterので使うのでglobooffオプションを追加する

userを削除

$ curl -X DELETE https://api.appstoreconnect.apple.com/v1/users/{id} -H "Authorization: Bearer $token"

https://developer.apple.com/documentation/appstoreconnectapi/remove_visible_apps_from_a_user

{id}はuserの情報を参照して取得する。