Organization Exports in Python


#1

Hi,

I am trying to create a backup of our entire organization / workspace.

So I started a script in python based on the example that is given online (https://asana.com/developers/documentation/getting-started/quick-start), which works well.

Per organization export documentation (https://asana.com/developers/api-reference/organization_exports#), the first step is to trigger the export is to call ‘create’, which i do like this:

a = client.organization_exports.create({‘organization’:‘1234’})
12323 is where i enter our organization ID, or at least i believe it is

This throws an error though
InvalidRequestError: Invalid Request: organization: Not the correct type

This makes me think that the organization ID might not be correct. If so, where do I get the correct organization ID from?

Btw
Frank.


#2

Do a call to get the available workspaces for the Service Account you’re using. You can do this via the API in Python but you can also probably just use the Asana API Explorer since it’s only a one-time thing. The result from that call will include the ID for each workspace/organization. (It’s going to be a long number, 15 digits or so.)


#3

Phil, thanks that helped!

I just realized now that we are not an Enterprise, but only have the premium account.

Anyway, your hint helped me to use another API function to export the JSON files for each project.

Frank.