/odata/Exports(Key)/UiPath.Server.Configuration.OData.GetDownloadLink

Hi All,

I’m currently got one project which is to build a simple Orchestrator API. The main goal is to export log for all of the process that is running the whole day and store in the share folder.

Right now my plan is to used this OData (/odata/Exports(Key)/UiPath.Server.Configuration.OData.GetDownloadLink) to export the log, but I got confuses on what is the Key value actually and where can I get it (If possible using Orchestrator API also)

@Saiful,

You can refer this.

Thank you for the help but is there any ways to use the /odata/Exports(Key)/UiPath.Server.Configuration.OData.GetDownloadLink to get the URI

@Saiful,

I couldn’t try this but this is what the forum LLM thinks should work. Can you give it a try.

  1. Initiate the Export:
    First, start by calling the export API (typically via a POST request) to generate the log export. For example, if you were exporting jobs you might use:
POST https://{yourDomain}/odata/Jobs/UiPath.Server.Configuration.OData.Export?...

Your request body can include query parameters such as $top, $expand, and $orderby as needed. (If you’re exporting audit logs or other logs the endpoint might differ slightly.)
2. Poll for Export Completion:
The export call returns an object containing an export ID (for example, 8661). You then poll the status of the export by sending a GET request:

GET https://{yourDomain}/odata/Exports(8661)

Continue polling (using a short delay between requests) until the response shows that the export Status is "Completed".
3. Retrieve the Download URI:
Once the export is complete, use the exported ID to get the download link by making the following GET request:

GET https://{yourDomain}/odata/Exports(8661)/UiPath.Server.Configuration.OData.GetDownloadLink

This call returns a JSON response that contains a URI property. For example, the response might be similar to:

{
  "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto",
  "Uri": "<Download URI>",
  "Verb": "GET",
  "RequiresAuth": false,
  "Headers": { "Keys": [], "Values": [] }
}

This URI is a preauthorized link that you can use (via a GET request) to download the CSV file of the logs.
4. Download the Logs:
Finally, make a GET request to the URI provided in the response. This will trigger the download of the CSV file containing the exported logs.

Thank you for the help, I will give it a try later

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.