Can I use batch method on python client for asana?


#1

How can I use batch method on python client?


#2

If the library has not been updated recently, you won’t have access to the feature. You might need to look at the documentation yourself. In the Node source code there is a wrapper you can use to cover any un-coded feature with the right parameters. I don’t know if that exist in the python library.

Bastien
Asana consultant, author and developer


#3

Apologies for bumping an old thread but @Bastien_Siebman, could you show how to use Batch API on Node Client? I was looking to make separate API calls utilizing something like Axios but it would be great to make Batch API work within the Node Client functionality.


#4

Here some of my code to use an unsupported endpoint, like dealing with sections. Hope that helps.

        this.client = Asana.Client.create([...]);

        this.client.dispatcher.post(`/projects/${project.id}/sections`, payload)
            .then((section: any) => {
                [...]
            }, (err: RequestError) => {
                [...]
            });


#5

Thank you! client.dispatcher worked like a charm to create Batch API wrapper. Now I am on to the code to solve pagination process!


#6

That is wonderful news!