Freshdesk question export data

Thank you for your help so far.

Could you kindly share the API endpoint for pulling the Freshdesk tickets into Power BI.

Specifically if you can help us if it’s ticket export or activity export.

Schedule export sample:
https://yourcompany.freshdesk.com/reports/schedule/download_file.json?uuid=9da1a15a-15b8-4a44-baf7-c6e4152eea89
URL for activities : https://yourcompany.freshdesk.com/api/v2/export?ticket_activities

We fail to understand the question. What is the relationship with that tickets_incremental keeps spinning?

I’m sorry, it’s not related. Just had a session with FreshDesk support regarding a related topic and they asked this question. I was hoping that posting it here will get us a quick answer.

The export API is not available due to it being asynchroneous and some concurrence limitations.

Typically these can be addressed using NativePlatformScalarRequests, such as (not thoroughly tested):

declare
  l_company      varchar2 := 'acme';
  l_uid          varchar2;
  l_id           number;
  l_loop         boolean;
  l_download_url varchar2;
begin
  l_uid := to_char(newid());
  --
  -- Request async download of contact.
  -- Note that there is a limit: no concurrency.
  -- Otherwise a itgenfpr029 is returned.
  --
  insert into NativePlatformScalarRequests@fdk
  ( url
  , http_method
  , payload_text
  , orig_system_reference
  )
  values 
  ( 'https://' || l_company || '.freshdesk.com/api/v2/contacts/export'
  , 'POST'
  , '{ "fields": { "default_fields": ["name", "email"], "custom_fields": [] } }'
  , l_uid
  );
  --
  -- Retrieve request ID.
  --
  select jte.id
  into   l_id
  from   NativePlatformScalarRequests@fdk npt
  join   jsontable
         ( ''
           passing npt.result_text
           columns id varchar2 path 'id'
         ) jte
  where  npt.orig_system_reference = l_uid
  ;
  dbms_output.put_line('Request has ID ' || l_id || '.');
  --
  -- Wait till download finishes.
  --
  l_loop := true;
  while l_loop
  loop
    dbms_lock.sleep(15);
    l_uid := to_char(newid());
    insert into NativePlatformScalarRequests
    ( url
    , http_method
    , orig_system_reference
    )
    values
    ( 'https://' || l_company || '.freshdesk.com/api/v2/contacts/export/' || l_id
    , 'GET'
    , l_uid
    );
    --
    -- Check whether it is ready.
    --
    select download_url
    into   l_download_url
    from   NativePlatformScalarRequests@fdk
    join   jsontable
           ( ''
             passing result_text
             columns download_url varchar2 path 'download_url'
           ) jte
    where  orig_system_reference = l_uid
    ;
    if l_download_url is not null
    then
      l_loop := false;
    else
      dbms_output.put_line('Request not finished, trying again in few seconds.');
    end if;
  end loop;
  --
  -- When in an app on App Online, use cloud_http to create a download.
  -- Or use csvtable to parse the contents.
  --
  dbms_output.put_line('URL:');
  dbms_output.put_line(l_download_url);
end;

This question was automatically closed after at least 2 weeks of inactivity after a possible solution was provided. The last answer given has been marked as a solution.

Please ask a new question via a separate topic if the problem occurs again. Please include a link to this topic in the new question by pasting its URL into the text.