0
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.

Automation 360のAPIで悩む(200個制限?)

Last updated at Posted at 2022-08-06

はじめに

先日「第15回 AA de Knight(*1)」という勉強会に参加させてもらいました。この「AA de Knight」、Automation Anywhereを触っている人には、とてもお勧めです。
(なお私はSB C&Sの人ではありません。宣伝じゃないよ)

さて、その中でAA API活用の話があり、またちょうどControl RoomのBotの情報をまとめて取得したいという相談があって「file/list」のAPIを使ってみました。
そのときに情報は200個以上あるはずなのに、200個までしかとれず悩んだ、という小ネタです。

(*1) https://aaj.connpass.com/event/245785/

最初のフィルタ

Botの情報をできるだけ多く取りたいという事で以下のフィルタを書きました。

{
  "filter": {
       "operator": "substring",
       "value": "Automation Anywhere\\Bots",
       "field": "path"
      }
}  

でも、全部のBot情報が取れていないように見えました。
戻りのJSON見ると以下が返ってきてて、いかにも200個で制限がかかっていそうです。

{'page': {'offset': 0, 'total': 1027, 'totalFilter': 200},

上限をあげるフィルタ

結論から言うとA-peopleに書いてあったやり方で回避できました。

{
  "page": {
      "offset": 0, 
      "length":3000
      },
  "filter": {
       "operator": "substring",
       "value": "Automation Anywhere\\Bots",
       "field": "path"
      }
}  

戻りを見ても...

{'page': {'offset': 0, 'total': 1027, 'totalFilter': 1022}, 

あ、なんかとれてそう。
(実際にはこのあとに大量の情報が取れています)

簡単なまとめ

A-peopleに書いてあったのは、ユーザ情報を全部とりたいのに200人分しかとれない!?って話でした。
情報取得系のAPIで全部とれない、と悩まれた場合は"page":{length:数値}を調整してみましょう、という話です。

おまけ

AA社のWebページで、この200個制限の話を探したのですが、見つける事ができませんでした。
(1時間くらいしか探してないから、見落としているかも...)
この制限について書いてある場所、ご存じの方、教えて頂ければ幸いです。

0
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
0
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?