"Invalid ID" error when retrieving the status of an export via the Export API

Hello, I am attempting to kick off an export via the API and then retrieve its status as described here: https://developers.trello.com/docs/automating-exports

I am able to kick off the export successfully and retrieve the export ID. However, when I attempt to check the status of the export, I receive the following exception:

{"message":"Invalid id","error":"ERROR"}

My PowerShell code is below. Can you spot what I’m doing wrong?

#Call Trello Rest API to initiate export of all team boards to a zip file
$exportJson = Invoke-WebRequest -method POST "https://api.trello.com/1/organizations/$teamID/exports?attachments=false&key=$key&token=$token"

#Retrieve Export ID
$export = $exportJson.Content | ConvertFrom-Json
$exportID = $export.id
Write-Output "Export ID:$exportID"

#Retrieve Export Status
$exportStatus = Invoke-WebRequest "https://trello.com/1/organizations/$teamID/exports/$exportID?key=$key&token=$token"
return $exportStatus

I don’t think that this would cause the error that you’re seeing, but it is worth correcting–the second route is missing the api. subdomain. Can you change it so that they both are making requests to https://api.trello.com and then give it a try?

Edit: I see now that our docs don’t use the api. subdomain. I believe that they should be, but am going to double-check.

1 Like

Can you also verify that the export ID you are seeing is included when you list all of the exports for the organization?

$exportStatus = Invoke-WebRequest "https://api.trello.com/1/organizations/$teamID/exports/?key=$key&token=$token"
1 Like

I verified that the id was indeed included in the list, but I think I figured out the issue.

The documentation lists the uri for retrieving the export status as:
https://trello.com/1/organizations/{orgIdOrName}/exports/{exportId}?key={key}&token={token}

I believe there is a slash missing after the {exportId}. Once I add the slash, it works:
https://trello.com/1/organizations/{orgIdOrName}/exports/{exportId}/?key={key}&token={token}

I’ll go ahead and suggest an edit to the documentation. Thanks for your help!