Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement batch API #370

Open
ScottG489 opened this issue Oct 13, 2023 · 0 comments
Open

Implement batch API #370

ScottG489 opened this issue Oct 13, 2023 · 0 comments

Comments

@ScottG489
Copy link

Trello offers an API for batching requests. You basically specify the URL paths as you would normally for each API call and send those paths to the batch endpoint. A full URL to do this would look something like this for example:

https://api.trello.com/1/batch?urls=/boards/123?fields=name,/boards/456/lists?fields=name&cards=open&card_fields=idCard

The response is a list of response objects keyed off each sub-response's code and then the response itself. For example:

[
  {
    "200": [
      {
        "id": "5b7756800e4a7650df54ea64",
        "name": "To Do"
      }
    ]
  },
  {
    "200": [
      {
        "id": "5b7756817af1c20b60196fa8",
        "name": "Done"
      }
    ]
  }
]

The batch endpoint is great for reducing the number of requests you make. It's more efficient and can be critical to staying under their rate limits.

There isn't much documentation, but here's what they have:
https://developer.atlassian.com/cloud/trello/rest/api-group-batch/#api-group-batch

Here's an example of it used in action except just going through fetch_json

I'd like to have this implemented more natively (e.g. adding a batch method to the client) and I'm happy to take a swing at it since I've worked with the Trello API fairly extensively.

Let me know if you have any thoughts on how this should be implemented. Otherwise, I'll open a PR and we can see how it looks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant